Skip to content

Commit

Permalink
refactor(ecs): move events to system dir
Browse files Browse the repository at this point in the history
  • Loading branch information
RiscadoA committed Oct 2, 2023
1 parent 7583e22 commit a2d710a
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// @file
/// @brief Resource @ref cubos::core::ecs::EventPipe.
/// @ingroup core-ecs
/// @ingroup core-ecs-system

#pragma once

Expand All @@ -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 <typename T>
class EventPipe
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/// @file
/// @brief Class @ref cubos::core::ecs::EventReader.
/// @ingroup core-ecs
/// @ingroup core-ecs-system

#pragma once

#include <optional>

#include <cubos/core/ecs/event_pipe.hpp>
#include <cubos/core/ecs/system/event/pipe.hpp>

namespace cubos::core::ecs
{
Expand All @@ -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 <typename T, unsigned int M = DEFAULT_FILTER_MASK>
class EventReader
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/// @file
/// @brief Class @ref cubos::core::ecs::EventWriter.
/// @ingroup core-ecs
/// @ingroup core-ecs-system

#pragma once

#include <cubos/core/ecs/event_pipe.hpp>
#include <cubos/core/ecs/system/event/pipe.hpp>

namespace cubos::core::ecs
{
/// @brief System argument which allows the system to send events of type @p T to other
/// systems.
/// @see Systems can read sent events using @ref EventReader.
/// @tparam T
/// @ingroup core-ecs
/// @ingroup core-ecs-system
template <typename T>
class EventWriter
{
Expand Down
3 changes: 3 additions & 0 deletions core/include/cubos/core/ecs/system/module.dox
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/// @dir
/// @brief @ref core-ecs-system directory.

/// @dir event
/// @brief Event system arguments directory.

namespace cubos::core::ecs
{
/// @defgroup core-ecs-system System
Expand Down
4 changes: 2 additions & 2 deletions core/include/cubos/core/ecs/system/system.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
#include <typeindex>
#include <unordered_set>

#include <cubos/core/ecs/event_reader.hpp>
#include <cubos/core/ecs/event_writer.hpp>
#include <cubos/core/ecs/system/accessors.hpp>
#include <cubos/core/ecs/system/commands.hpp>
#include <cubos/core/ecs/system/event/reader.hpp>
#include <cubos/core/ecs/system/event/writer.hpp>
#include <cubos/core/ecs/system/query.hpp>
#include <cubos/core/ecs/world.hpp>

Expand Down
6 changes: 3 additions & 3 deletions core/samples/ecs/events/main.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <cubos/core/ecs/event_pipe.hpp>
#include <cubos/core/ecs/event_reader.hpp>
#include <cubos/core/ecs/event_writer.hpp>
#include <cubos/core/ecs/system/event/pipe.hpp>
#include <cubos/core/ecs/system/event/reader.hpp>
#include <cubos/core/ecs/system/event/writer.hpp>
#include <cubos/core/log.hpp>
#include <cubos/core/memory/stream.hpp>

Expand Down
2 changes: 1 addition & 1 deletion engine/include/cubos/engine/cubos.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
#include <set>
#include <string>

#include <cubos/core/ecs/event_pipe.hpp>
#include <cubos/core/ecs/system/dispatcher.hpp>
#include <cubos/core/ecs/system/event/pipe.hpp>
#include <cubos/core/ecs/system/system.hpp>
#include <cubos/core/ecs/world.hpp>

Expand Down
4 changes: 2 additions & 2 deletions engine/samples/events/main.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <cubos/core/ecs/event_reader.hpp>
#include <cubos/core/ecs/event_writer.hpp>
#include <cubos/core/ecs/system/event/reader.hpp>
#include <cubos/core/ecs/system/event/writer.hpp>

#include <cubos/engine/cubos.hpp>

Expand Down

0 comments on commit a2d710a

Please sign in to comment.