diff --git a/cmake/dependencies.cmake b/cmake/dependencies.cmake index d01df530..fc60259f 100644 --- a/cmake/dependencies.cmake +++ b/cmake/dependencies.cmake @@ -12,4 +12,9 @@ FetchContent_Declare( URL https://github.com/skypjack/entt/archive/master.zip ) -FetchContent_MakeAvailable(doctest entt) \ No newline at end of file +FetchContent_Declare( + doom_st + URL https://github.com/doom/strong_type/archive/1.0.2.tar.gz +) + +FetchContent_MakeAvailable(doctest entt doom_st) \ No newline at end of file diff --git a/modules/ecs/CMakeLists.txt b/modules/ecs/CMakeLists.txt index 2a1bcac1..19569044 100644 --- a/modules/ecs/CMakeLists.txt +++ b/modules/ecs/CMakeLists.txt @@ -2,7 +2,7 @@ add_library(antara_ecs_shared_sources INTERFACE) target_sources(antara_ecs_shared_sources INTERFACE antara/gaming/ecs/base.system.cpp) target_include_directories(antara_ecs_shared_sources INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) -target_link_libraries(antara_ecs_shared_sources INTERFACE EnTT) +target_link_libraries(antara_ecs_shared_sources INTERFACE EnTT strong_type) add_library(antara::ecs_shared_sources ALIAS antara_ecs_shared_sources) diff --git a/modules/ecs/antara/gaming/ecs/antara.ecs.system.tests.cpp b/modules/ecs/antara/gaming/ecs/antara.ecs.system.tests.cpp index cb69878f..598adab8 100644 --- a/modules/ecs/antara/gaming/ecs/antara.ecs.system.tests.cpp +++ b/modules/ecs/antara/gaming/ecs/antara.ecs.system.tests.cpp @@ -26,6 +26,11 @@ TEST_CASE ("base system abstract object tests") } + [[nodiscard]] antara::gaming::ecs::system_type get_system_type_RTTI() const noexcept final + { + return antara::gaming::ecs::system_type::logic_update; + } + void update() noexcept final { //! diff --git a/modules/ecs/antara/gaming/ecs/base.system.hpp b/modules/ecs/antara/gaming/ecs/base.system.hpp index 913ece41..0d2bbbf5 100644 --- a/modules/ecs/antara/gaming/ecs/base.system.hpp +++ b/modules/ecs/antara/gaming/ecs/base.system.hpp @@ -18,7 +18,7 @@ #include #include -#include "antara/gaming/ecs/base.system.hpp" +#include "antara/gaming/ecs/system.type.hpp" namespace antara::gaming::ecs { @@ -33,6 +33,8 @@ namespace antara::gaming::ecs //! Pure virtual functions virtual void update() noexcept = 0; + [[nodiscard]] virtual system_type get_system_type_RTTI() const noexcept = 0; + /** * \note This function marks the system, it will be destroyed in the next turn of the game loop by the system_manager. diff --git a/modules/ecs/antara/gaming/ecs/system.type.hpp b/modules/ecs/antara/gaming/ecs/system.type.hpp new file mode 100644 index 00000000..cf644eaa --- /dev/null +++ b/modules/ecs/antara/gaming/ecs/system.type.hpp @@ -0,0 +1,34 @@ +/****************************************************************************** + * Copyright © 2013-2019 The Komodo Platform Developers. * + * * + * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * + * the top-level directory of this distribution for the individual copyright * + * holder information and the developer policies on copyright and licensing. * + * * + * Unless otherwise agreed in a custom licensing agreement, no part of the * + * Komodo Platform software, including this file may be copied, modified, * + * propagated or distributed except according to the terms contained in the * + * LICENSE file * + * * + * Removal or modification of this copyright notice is prohibited. * + * * + ******************************************************************************/ + +#pragma once + +#include + +namespace antara::gaming::ecs +{ + enum system_type + { + pre_update, + logic_update, + post_update, + size + }; + + using st_system_pre_update = st::type; + using st_system_logic_update = st::type; + using st_system_post_update = st::type; +} \ No newline at end of file