Phase Class
Represents a phase in the game loop containing multiple passes. More...
Declaration
Friends Index
| class | helios::engine::runtime::gameloop::GameLoop |
Public Constructors Index
| Phase (helios::engine::runtime::gameloop::GameLoop &gameloop, GameWorld &gameWorld) | |
|
Constructs a Phase with references to GameLoop and GameWorld. More... | |
Public Member Functions Index
| bool | addPassEndListener (PassEndListener *passEndListener) |
|
Registers a listener to be notified when passes end. More... | |
template <typename StateType> | |
| Pass & | beginPass (const StateType t) |
|
Creates and adds a new typed pass to this phase. More... | |
| helios::engine::runtime::gameloop::GameLoop & | gameLoop () noexcept |
Private Member Functions Index
| void | init (GameWorld &gameWorld) |
|
Initializes all passes within this phase. More... | |
| void | update (GameWorld &gameWorld, UpdateContext &updateContext) |
|
Updates all passes within this phase. More... | |
| bool | notifyPassEndListeners (Pass &pass, GameWorld &gameWorld, UpdateContext &updateContext) |
|
Notifies all registered listeners about a pass reaching its end. More... | |
Private Member Attributes Index
| std::vector< PassEndListener * > | passEndListeners_ |
|
Collection of listeners to be notified when a pass ends. More... | |
| std::vector< std::unique_ptr< Pass > > | passEntries_ |
|
Collection of passes belonging to this phase. More... | |
| helios::engine::runtime::gameloop::GameLoop & | gameloop_ |
| helios::engine::runtime::world::GameWorld & | gameWorld_ |
Description
Represents a phase in the game loop containing multiple passes.
- See Also
- See Also
Definition at line 62 of file Phase.ixx.
Friends
helios::engine::runtime::gameloop::GameLoop
Definition at line 64 of file Phase.ixx.
Public Constructors
Phase()
| inline explicit |
Constructs a Phase with references to GameLoop and GameWorld.
- Parameters
-
gameloop Reference to the parent GameLoop.
gameWorld Shared GameWorld used by passes in this phase.
Definition at line 148 of file Phase.ixx.
Public Member Functions
addPassEndListener()
| inline |
Registers a listener to be notified when passes end.
- Parameters
-
passEndListener Pointer to the listener to register. Must remain valid for the lifetime of this Phase or until removed.
- Returns
True if the listener was added, false if it was already registered.
- See Also
- See Also
notifyPassEndListeners()
Definition at line 164 of file Phase.ixx.
Reference helios::engine::runtime::registerComponents.
Referenced by helios::engine::runtime::gameloop::GameLoop::init.
beginPass()
| inline |
Creates and adds a new typed pass to this phase.
The state parameter specifies in which states this pass should execute. Passes are skipped if the current state does not match the configured mask (using bitwise AND). New passes are bound to this phase's GameWorld reference.
- Template Parameters
-
StateType The state enum type (e.g., GameState, MatchState).
- Parameters
-
t The state mask specifying when this pass should run.
- Returns
Reference to the newly created Pass for method chaining.
- See Also
- See Also
Definition at line 195 of file Phase.ixx.
Reference helios::engine::runtime::registerComponents.
gameLoop()
| inline noexcept |
Private Member Functions
init()
| inline |
notifyPassEndListeners()
| inline |
Notifies all registered listeners about a pass reaching its end.
- Parameters
-
pass The pass that reached its end.
gameWorld The game world where the pass end occured.
updateContext The current update context.
- Returns
Always returns true.
- See Also
PassEndListener::onPassCommit()
- See Also
Definition at line 120 of file Phase.ixx.
update()
| inline |
Updates all passes within this phase.
- Parameters
-
gameWorld The game world where the update occurred.
updateContext The current update context.
- See Also
- See Also
Pass::addCommitPoint()
- See Also
Pass::runsIn()
Definition at line 96 of file Phase.ixx.
Private Member Attributes
gameloop_
|
Reference to the owning GameLoop.
Definition at line 136 of file Phase.ixx.
gameWorld_
|
Definition at line 138 of file Phase.ixx.
passEndListeners_
|
passEntries_
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.