Skip to main content

StateTransitionRequest.ixx File

Request to trigger a state transition. More...

Included Headers

Namespaces Index

namespacehelios
namespaceengine

Main engine module aggregating core infrastructure and game systems. More...

namespacestate

Generic, template-based state management system. More...

namespacetypes

Type definitions for state transitions. More...

Classes Index

classStateTransitionRequest<StateType>

Represents a request to perform a state transition. More...

Description

Request to trigger a state transition.

File Listing

The file content with the documentation metadata removed is:

1/**
2 * @file StateTransitionRequest.ixx
3 * @brief Request to trigger a state transition.
4 */
5module;
6
7
8export module helios.engine.state.types.StateTransitionRequest;
9
10
11import helios.engine.state.types.StateTransitionId;
12import helios.engine.state.types.StateTransitionType;
13
14export namespace helios::engine::state::types {
15
16 /**
17 * @brief Represents a request to perform a state transition.
18 *
19 * @details Contains the current state and the desired transition ID.
20 * The StateManager uses registered rules to determine the target state.
21 *
22 * @tparam StateType The state enum type.
23 *
24 * @see StateCommand
25 * @see StateManager
26 */
27 template<typename StateType>
29
30 using StateTransitionIdType = StateTransitionIdType<StateType>;
31
32 /**
33 * @brief The current state to transition from.
34 */
35 StateType from_;
36
37 /**
38 * @brief The transition to perform.
39 */
40 StateTransitionIdType transitionId_;
41
42
43 public:
44
45 /**
46 * @brief Constructs a transition request.
47 *
48 * @param from The current state.
49 * @param transitionId The transition to perform.
50 */
52 const StateType from,
53 const StateTransitionIdType transitionId
54 ) : from_(from), transitionId_(transitionId) {}
55
56 /**
57 * @brief Returns the source state.
58 *
59 * @return The state to transition from.
60 */
61 [[nodiscard]] StateType from() const noexcept {
62 return from_;
63 }
64
65 /**
66 * @brief Returns the transition identifier.
67 *
68 * @return The ID of the requested transition.
69 */
70 [[nodiscard]] StateTransitionIdType transitionId() const noexcept {
71 return transitionId_;
72 }
73
74 };
75
76}

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.