diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 57a7a7a..01edba3 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -1,4 +1,7 @@ + +find_package(Boost 1.62 REQUIRED) + set(CORE_HEADERS entity.h ) @@ -6,4 +9,5 @@ set(CORE_SOURCES entity.cpp ) -add_library(core STATIC ${CORE_SOURCES}) \ No newline at end of file +add_library(core STATIC ${CORE_SOURCES}) +target_link_libraries(core Boost::boost) \ No newline at end of file diff --git a/src/core/entity.cpp b/src/core/entity.cpp index cb9925d..4c9ece5 100644 --- a/src/core/entity.cpp +++ b/src/core/entity.cpp @@ -1,6 +1,7 @@ #include "entity.h" -Entity::Entity() -{ +#include +Entity::Entity() : uuid(boost::uuids::random_generator()()) +{ } \ No newline at end of file diff --git a/src/core/entity.h b/src/core/entity.h index ab68b40..e7afcbe 100644 --- a/src/core/entity.h +++ b/src/core/entity.h @@ -1,13 +1,18 @@ #ifndef ENTITY_H #define ENTITY_H +#include + +#include + class Entity { public: Entity(); ~Entity(); + const boost::uuids::uuid& getUuid() {return uuid;}; private: - int uuid{-1}; + boost::uuids::uuid uuid; }; #endif //ENTITY_H \ No newline at end of file