-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3051b8d
commit 76cbed2
Showing
3 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/// @file | ||
/// @brief Class @ref cubos::core::ecs::Name. | ||
/// @ingroup core-ecs | ||
|
||
#pragma once | ||
|
||
#include <string> | ||
|
||
#include <cubos/core/reflection/reflect.hpp> | ||
|
||
namespace cubos::core::ecs | ||
{ | ||
///@brief Component which stores the name of an entity. | ||
|
||
struct Name | ||
{ | ||
CUBOS_REFLECT; | ||
|
||
/// @brief Name of the entity. | ||
std::string value; | ||
}; | ||
} // namespace cubos::core::ecs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#include <cubos/core/ecs/name.hpp> | ||
|
||
#include <cubos/core/ecs/reflection.hpp> | ||
#include <cubos/core/reflection/external/string.hpp> | ||
|
||
CUBOS_REFLECT_IMPL(cubos::core::ecs::Name) | ||
{ | ||
return core::ecs::TypeBuilder<Name>("cubos::core::ecs::Name") | ||
.withField("name", &Name::value) | ||
.build(); | ||
} |