diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 3c55e30e8c..9166f46b1e 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -75,11 +75,11 @@ set(CUBOS_CORE_SOURCE "src/cubos/core/ecs/entity/manager.cpp" "src/cubos/core/ecs/component/registry.cpp" "src/cubos/core/ecs/component/manager.cpp" - "src/cubos/core/ecs/commands.cpp" + "src/cubos/core/ecs/system/system.cpp" + "src/cubos/core/ecs/system/dispatcher.cpp" + "src/cubos/core/ecs/system/commands.cpp" "src/cubos/core/ecs/blueprint.cpp" "src/cubos/core/ecs/world.cpp" - "src/cubos/core/ecs/system.cpp" - "src/cubos/core/ecs/dispatcher.cpp" ) # Create core library diff --git a/core/include/cubos/core/ecs/blueprint.hpp b/core/include/cubos/core/ecs/blueprint.hpp index 760a646c50..e2a44f220d 100644 --- a/core/include/cubos/core/ecs/blueprint.hpp +++ b/core/include/cubos/core/ecs/blueprint.hpp @@ -7,8 +7,8 @@ #include #include #include -#include #include +#include #include #include diff --git a/core/include/cubos/core/ecs/accessors.hpp b/core/include/cubos/core/ecs/system/accessors.hpp similarity index 97% rename from core/include/cubos/core/ecs/accessors.hpp rename to core/include/cubos/core/ecs/system/accessors.hpp index a3f9d39c71..58da8a7d95 100644 --- a/core/include/cubos/core/ecs/accessors.hpp +++ b/core/include/cubos/core/ecs/system/accessors.hpp @@ -1,6 +1,6 @@ /// @file /// @brief Class @ref cubos::core::ecs::Read and related types. -/// @ingroup core-ecs +/// @ingroup core-ecs-system #pragma once @@ -14,7 +14,7 @@ namespace cubos::core::ecs /// Can be used as a pointer with both the `->` and `*` operators. /// /// @tparam T Resource or component type. - /// @ingroup core-ecs + /// @ingroup core-ecs-system template class Read { @@ -50,7 +50,7 @@ namespace cubos::core::ecs /// Can be used as a pointer with both the `->` and `*` operators. /// /// @tparam T Resource or component type. - /// @ingroup core-ecs + /// @ingroup core-ecs-system template class Write { @@ -87,7 +87,7 @@ namespace cubos::core::ecs /// Can be used as a pointer with both the `->` and `*` operators. /// /// @tparam T Resource or component type. - /// @ingroup core-ecs + /// @ingroup core-ecs-system template class OptRead { @@ -139,7 +139,7 @@ namespace cubos::core::ecs /// Can be used as a pointer with both the `->` and `*` operators. /// /// @tparam T Resource or component type. - /// @ingroup core-ecs + /// @ingroup core-ecs-system template class OptWrite { diff --git a/core/include/cubos/core/ecs/commands.hpp b/core/include/cubos/core/ecs/system/commands.hpp similarity index 98% rename from core/include/cubos/core/ecs/commands.hpp rename to core/include/cubos/core/ecs/system/commands.hpp index 5f1641a6b7..6c87aebf41 100644 --- a/core/include/cubos/core/ecs/commands.hpp +++ b/core/include/cubos/core/ecs/system/commands.hpp @@ -1,6 +1,6 @@ /// @file /// @brief Class @ref cubos::core::ecs::Commands and related types. -/// @ingroup core-ecs +/// @ingroup core-ecs-system #pragma once @@ -18,7 +18,7 @@ namespace cubos::core::ecs class Dispatcher; /// @brief Allows editing an entity created by a @ref Commands object. - /// @ingroup core-ecs + /// @ingroup core-ecs-system class EntityBuilder final { public: @@ -54,7 +54,7 @@ namespace cubos::core::ecs }; /// @brief Used to edit a blueprint spawned by a @ref Commands object. - /// @ingroup core-ecs + /// @ingroup core-ecs-system class BlueprintBuilder final { public: @@ -102,11 +102,11 @@ namespace cubos::core::ecs BlueprintBuilder(data::old::SerializationMap&& map, CommandBuffer& commands); }; - /// @brief Used to write ECS commands and execute them at a later time. + /// @brief System argument used to write ECS commands and execute them at a later time. /// /// Internally wraps a reference to a CommandBuffer object. /// - /// @ingroup core-ecs + /// @ingroup core-ecs-system class Commands final { public: @@ -151,7 +151,7 @@ namespace cubos::core::ecs }; /// @brief Stores commands to execute them later. - /// @ingroup core-ecs + /// @ingroup core-ecs-system class CommandBuffer final { public: diff --git a/core/include/cubos/core/ecs/dispatcher.hpp b/core/include/cubos/core/ecs/system/dispatcher.hpp similarity index 99% rename from core/include/cubos/core/ecs/dispatcher.hpp rename to core/include/cubos/core/ecs/system/dispatcher.hpp index cbe469bb9f..96b01d1137 100644 --- a/core/include/cubos/core/ecs/dispatcher.hpp +++ b/core/include/cubos/core/ecs/system/dispatcher.hpp @@ -1,6 +1,6 @@ /// @file /// @brief Class @ref cubos::core::ecs::Dispatcher. -/// @ingroup core-ecs +/// @ingroup core-ecs-system #pragma once @@ -10,7 +10,7 @@ #include #include -#include +#include #include #define ENSURE_CURR_SYSTEM() \ @@ -51,7 +51,7 @@ namespace cubos::core::ecs { /// @brief Used to add systems and relations between them and then dispatch them all at once. - /// @ingroup core-ecs + /// @ingroup core-ecs-system class Dispatcher { public: diff --git a/core/include/cubos/core/ecs/event_pipe.hpp b/core/include/cubos/core/ecs/system/event/pipe.hpp similarity index 98% rename from core/include/cubos/core/ecs/event_pipe.hpp rename to core/include/cubos/core/ecs/system/event/pipe.hpp index 3b5372167b..f0bea9ac1f 100644 --- a/core/include/cubos/core/ecs/event_pipe.hpp +++ b/core/include/cubos/core/ecs/system/event/pipe.hpp @@ -1,6 +1,6 @@ /// @file /// @brief Resource @ref cubos::core::ecs::EventPipe. -/// @ingroup core-ecs +/// @ingroup core-ecs-system #pragma once @@ -15,7 +15,7 @@ namespace cubos::core::ecs /// @brief Resource which stores events of type @p T. /// @note This resource is meant to be used through @ref EventReader and @ref EventWriter. /// @tparam T Event type. - /// @ingroup core-ecs + /// @ingroup core-ecs-system template class EventPipe { diff --git a/core/include/cubos/core/ecs/event_reader.hpp b/core/include/cubos/core/ecs/system/event/reader.hpp similarity index 97% rename from core/include/cubos/core/ecs/event_reader.hpp rename to core/include/cubos/core/ecs/system/event/reader.hpp index 7421240852..c4a2ae41cd 100644 --- a/core/include/cubos/core/ecs/event_reader.hpp +++ b/core/include/cubos/core/ecs/system/event/reader.hpp @@ -1,12 +1,12 @@ /// @file /// @brief Class @ref cubos::core::ecs::EventReader. -/// @ingroup core-ecs +/// @ingroup core-ecs-system #pragma once #include -#include +#include namespace cubos::core::ecs { @@ -18,7 +18,7 @@ namespace cubos::core::ecs /// @see Systems can send events using @ref EventWriter. /// @tparam T Event. /// @tparam M Filter mask. - /// @ingroup core-ecs + /// @ingroup core-ecs-system template class EventReader { diff --git a/core/include/cubos/core/ecs/event_writer.hpp b/core/include/cubos/core/ecs/system/event/writer.hpp similarity index 90% rename from core/include/cubos/core/ecs/event_writer.hpp rename to core/include/cubos/core/ecs/system/event/writer.hpp index 16149f5362..6dd99b8994 100644 --- a/core/include/cubos/core/ecs/event_writer.hpp +++ b/core/include/cubos/core/ecs/system/event/writer.hpp @@ -1,10 +1,10 @@ /// @file /// @brief Class @ref cubos::core::ecs::EventWriter. -/// @ingroup core-ecs +/// @ingroup core-ecs-system #pragma once -#include +#include namespace cubos::core::ecs { @@ -12,7 +12,7 @@ namespace cubos::core::ecs /// systems. /// @see Systems can read sent events using @ref EventReader. /// @tparam T - /// @ingroup core-ecs + /// @ingroup core-ecs-system template class EventWriter { diff --git a/core/include/cubos/core/ecs/system/module.dox b/core/include/cubos/core/ecs/system/module.dox new file mode 100644 index 0000000000..cd19b593c8 --- /dev/null +++ b/core/include/cubos/core/ecs/system/module.dox @@ -0,0 +1,12 @@ +/// @dir +/// @brief @ref core-ecs-system directory. + +/// @dir event +/// @brief Event system arguments directory. + +namespace cubos::core::ecs +{ + /// @defgroup core-ecs-system System + /// @ingroup core-ecs + /// @brief System part of the ECS. +} diff --git a/core/include/cubos/core/ecs/query.hpp b/core/include/cubos/core/ecs/system/query.hpp similarity index 97% rename from core/include/cubos/core/ecs/query.hpp rename to core/include/cubos/core/ecs/system/query.hpp index a5167fb048..38dbb25ec1 100644 --- a/core/include/cubos/core/ecs/query.hpp +++ b/core/include/cubos/core/ecs/system/query.hpp @@ -4,7 +4,7 @@ /// This file is a bit scary, but it's not as bad as it looks. It's mostly template specializations /// to handle the different types of arguments a query can take. /// -/// @ingroup core-ecs +/// @ingroup core-ecs-system #pragma once @@ -13,13 +13,13 @@ #include #include -#include +#include #include namespace cubos::core::ecs { /// @brief Describes a query. - /// @ingroup core-ecs + /// @ingroup core-ecs-system struct QueryInfo { std::unordered_set read; ///< Componenst read. @@ -89,8 +89,8 @@ namespace cubos::core::ecs }; } // namespace impl - /// @brief Holds the result of a query over all entities in world which match the given - /// arguments. + /// @brief System argument which holds the result of a query over all entities in world which + /// match the given arguments. /// /// An example of a valid query is: /// @@ -103,7 +103,7 @@ namespace cubos::core::ecs /// not present in the entity. Whenever mutability is not needed, Read/OptRead should be used. /// /// @tparam ComponentTypes Component accessor types to be queried. - /// @ingroup core-ecs + /// @ingroup core-ecs-system template class Query { diff --git a/core/include/cubos/core/ecs/system.hpp b/core/include/cubos/core/ecs/system/system.hpp similarity index 98% rename from core/include/cubos/core/ecs/system.hpp rename to core/include/cubos/core/ecs/system/system.hpp index 1f81d8069a..5def106242 100644 --- a/core/include/cubos/core/ecs/system.hpp +++ b/core/include/cubos/core/ecs/system/system.hpp @@ -4,7 +4,7 @@ /// This file is a bit scary, but it's not as bad as it looks. It's mostly template specializations /// to handle the different types of arguments a system can take. /// -/// @ingroup core-ecs +/// @ingroup core-ecs-system #pragma once @@ -12,17 +12,17 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include namespace cubos::core::ecs { /// @brief Describes a system. - /// @ingroup core-ecs + /// @ingroup core-ecs-system struct SystemInfo { /// @brief Whether the system uses commands or not. @@ -62,7 +62,7 @@ namespace cubos::core::ecs /// @brief Base class for system wrappers. /// @tparam R Return type of the wrapped system. - /// @ingroup core-ecs + /// @ingroup core-ecs-system template class AnySystemWrapper { @@ -304,7 +304,7 @@ namespace cubos::core::ecs /// @brief Wrapper for a system of type @p F. /// @tparam F Type of the system function/method/lambda. - /// @ingroup core-ecs + /// @ingroup core-ecs-system template class SystemWrapper final : public AnySystemWrapper::Return> { diff --git a/core/samples/ecs/events/main.cpp b/core/samples/ecs/events/main.cpp index d31f2c88e6..a4c7f13ad6 100644 --- a/core/samples/ecs/events/main.cpp +++ b/core/samples/ecs/events/main.cpp @@ -1,6 +1,6 @@ -#include -#include -#include +#include +#include +#include #include #include diff --git a/core/samples/ecs/general/main.cpp b/core/samples/ecs/general/main.cpp index bf531fc0f1..88babffdb3 100644 --- a/core/samples/ecs/general/main.cpp +++ b/core/samples/ecs/general/main.cpp @@ -1,13 +1,13 @@ #include #include -#include #include #include #include #include -#include -#include +#include +#include +#include #include using namespace cubos::core; diff --git a/core/src/cubos/core/ecs/commands.cpp b/core/src/cubos/core/ecs/system/commands.cpp similarity index 98% rename from core/src/cubos/core/ecs/commands.cpp rename to core/src/cubos/core/ecs/system/commands.cpp index 63db86aa2e..843ccadd88 100644 --- a/core/src/cubos/core/ecs/commands.cpp +++ b/core/src/cubos/core/ecs/system/commands.cpp @@ -1,5 +1,5 @@ #include -#include +#include using namespace cubos::core::ecs; diff --git a/core/src/cubos/core/ecs/dispatcher.cpp b/core/src/cubos/core/ecs/system/dispatcher.cpp similarity index 99% rename from core/src/cubos/core/ecs/dispatcher.cpp rename to core/src/cubos/core/ecs/system/dispatcher.cpp index c4b1cd6551..61be65f90d 100644 --- a/core/src/cubos/core/ecs/dispatcher.cpp +++ b/core/src/cubos/core/ecs/system/dispatcher.cpp @@ -1,6 +1,6 @@ #include -#include +#include using namespace cubos::core::ecs; diff --git a/core/src/cubos/core/ecs/system.cpp b/core/src/cubos/core/ecs/system/system.cpp similarity index 97% rename from core/src/cubos/core/ecs/system.cpp rename to core/src/cubos/core/ecs/system/system.cpp index 4498bba225..54a991d058 100644 --- a/core/src/cubos/core/ecs/system.cpp +++ b/core/src/cubos/core/ecs/system/system.cpp @@ -1,4 +1,4 @@ -#include +#include using namespace cubos::core::ecs; diff --git a/core/tests/ecs/commands.cpp b/core/tests/ecs/commands.cpp index 8ac2fcbe1e..277da701e2 100644 --- a/core/tests/ecs/commands.cpp +++ b/core/tests/ecs/commands.cpp @@ -1,6 +1,6 @@ #include -#include +#include #include "utils.hpp" diff --git a/core/tests/ecs/dispatcher.cpp b/core/tests/ecs/dispatcher.cpp index c3aabab630..abc0a7a65a 100644 --- a/core/tests/ecs/dispatcher.cpp +++ b/core/tests/ecs/dispatcher.cpp @@ -2,7 +2,7 @@ #include -#include +#include #include "utils.hpp" diff --git a/core/tests/ecs/query.cpp b/core/tests/ecs/query.cpp index 02a35a07ae..0c54d56887 100644 --- a/core/tests/ecs/query.cpp +++ b/core/tests/ecs/query.cpp @@ -1,6 +1,6 @@ #include -#include +#include #include "utils.hpp" diff --git a/core/tests/ecs/system.cpp b/core/tests/ecs/system.cpp index e01a7e2582..154ad68cce 100644 --- a/core/tests/ecs/system.cpp +++ b/core/tests/ecs/system.cpp @@ -3,7 +3,7 @@ #include -#include +#include #include "utils.hpp" diff --git a/engine/include/cubos/engine/cubos.hpp b/engine/include/cubos/engine/cubos.hpp index 470a3042c4..8795511fb7 100644 --- a/engine/include/cubos/engine/cubos.hpp +++ b/engine/include/cubos/engine/cubos.hpp @@ -7,9 +7,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include namespace cubos::engine diff --git a/engine/samples/events/main.cpp b/engine/samples/events/main.cpp index ad28ea83db..fc34b35545 100644 --- a/engine/samples/events/main.cpp +++ b/engine/samples/events/main.cpp @@ -1,5 +1,5 @@ -#include -#include +#include +#include #include diff --git a/engine/src/cubos/engine/collisions/broad_phase.hpp b/engine/src/cubos/engine/collisions/broad_phase.hpp index 45bc6c5097..d3cb66c6b0 100644 --- a/engine/src/cubos/engine/collisions/broad_phase.hpp +++ b/engine/src/cubos/engine/collisions/broad_phase.hpp @@ -3,7 +3,7 @@ #pragma once -#include +#include #include #include diff --git a/engine/src/cubos/engine/cubos.cpp b/engine/src/cubos/engine/cubos.cpp index 95f7e78c54..f0f32b939a 100644 --- a/engine/src/cubos/engine/cubos.cpp +++ b/engine/src/cubos/engine/cubos.cpp @@ -1,6 +1,6 @@ #include -#include +#include #include #include diff --git a/engine/src/cubos/engine/renderer/plugin.cpp b/engine/src/cubos/engine/renderer/plugin.cpp index a9f73afa56..b2456b8250 100644 --- a/engine/src/cubos/engine/renderer/plugin.cpp +++ b/engine/src/cubos/engine/renderer/plugin.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include diff --git a/engine/src/cubos/engine/tools/scene_editor/plugin.cpp b/engine/src/cubos/engine/tools/scene_editor/plugin.cpp index 4712b08cd6..c8ba30d6c8 100644 --- a/engine/src/cubos/engine/tools/scene_editor/plugin.cpp +++ b/engine/src/cubos/engine/tools/scene_editor/plugin.cpp @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include