match Folder
Folders Index
| folder | components |
| folder | events |
| folder | rules |
| folder | systems |
| folder | types |
Files Index
| file | helios/engine/mechanics/match/_module.ixx |
|
Match state management module for the helios engine. More... | |
| file | MatchStateManager.ixx |
|
Type alias for match state manager. More... | |
Description
helios::engine::mechanics::match
Match state management for the helios engine.
This module provides domain-specific types and bindings for managing match states (Warmup, Start, Countdown, Playing, PlayerDefeated, GameOver). It uses the generic helios::engine::state framework.
Components
| Component | Description |
|---|---|
| MatchStateManager | Type alias for StateManager<MatchState> |
| MatchState | Enum defining match/round lifecycle states |
| MatchStateTransitionId | Enum defining valid transition triggers |
Submodules
| Submodule | Purpose |
|---|---|
| rules/ | Default transition rules and guards |
| systems/ | Systems for match flow and rules |
| types/ | Core types, enums, and type trait specializations |
Architecture
MatchStateManager is a type alias for StateManager<MatchState>:
The generic StateManager provides:
- Rule-based transitions with optional guards
- Listener notifications on state changes
- Command-driven state changes via StateCommand<MatchState>
Match Flow
┌───────────────┐ WarmupRequest ┌───────────────┐
│ Undefined │ ─────────────────► │ Warmup │
└───────────────┘ └───────────────┘
│
StartRequest
│
▼
┌───────────────┐
│ Start │
└───────────────┘
│
CountdownRequest
(guarded)
│
▼
┌───────────────┐
│ Countdown │
└───────────────┘
│
PlayerSpawnRequest
│
▼
┌───────────────┐
│ Playing │
└───────────────┘
│
PlayerDied
│
▼
┌────────────────┐
│PlayerDefeated │
└────────────────┘
│ │
CountdownRequest GameOverRequest
(has life left) (no life left)
│ │
▼ ▼
Countdown ┌──────────┐
│ GameOver │
└──────────┘
Usage
using namespace helios::engine::mechanics::match;
using namespace helios::engine::state;
using namespace helios::engine::state::commands;
// Create manager with rules
auto manager = std::make_unique<MatchStateManager>(matchStateRules);
// Add listeners
manager->addStateListener(std::make_unique<LambdaStateListener<types::MatchState>>(
/* onExit, onTransition, onEnter callbacks */
));
// Submit transition via command
commandBuffer.add<StateCommand<types::MatchState>>(
StateTransitionRequest<types::MatchState>{
}
);
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.