Skip to main content

StateTransitionListener.ixx File

Interface for state transition observers. 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...

Classes Index

classStateTransitionListener<StateType>

Interface for observing state transitions. More...

Description

Interface for state transition observers.

File Listing

The file content with the documentation metadata removed is:

1/**
2 * @file StateTransitionListener.ixx
3 * @brief Interface for state transition observers.
4 */
5module;
6
7
8export module helios.engine.state.StateTransitionListener;
9
10import helios.engine.runtime.world.UpdateContext;
11
12import helios.engine.state.types;
13
14using namespace helios::engine::state::types;
15
16export namespace helios::engine::state {
17
18 /**
19 * @brief Interface for observing state transitions.
20 *
21 * @details Listeners are notified during state transitions in order:
22 * 1 onStateExit() - before leaving the current state
23 * 2 onStateTransition() - during the transition
24 * 3 onStateEnter() - after entering the new state
25 *
26 * @tparam StateType The state enum type.
27 *
28 * @see StateManager
29 * @see LambdaStateListener
30 */
31 template<typename StateType>
33
34
35 public:
36 virtual ~StateTransitionListener() = default;
37
38 /**
39 * @brief Called when exiting a state.
40 *
41 * @param updateContext The current frame's update context.
42 * @param from The state being exited.
43 */
44 virtual void onStateExit(
46 const StateType from
47 ) noexcept = 0;
48
49 /**
50 * @brief Called when entering a state.
51 *
52 * @param updateContext The current frame's update context.
53 * @param to The state being entered.
54 */
55 virtual void onStateEnter(
57 const StateType to
58 ) noexcept = 0;
59
60 /**
61 * @brief Called during a state transition.
62 *
63 * @param updateContext The current frame's update context.
64 * @param transitionCtx The complete transition context.
65 */
66 virtual void onStateTransition(
68 const StateTransitionContext<StateType> transitionCtx
69 ) noexcept = 0;
70
71
72
73
74 };
75
76}
77

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.