Skip to main content

types Namespace

Core types for match state management. More...

Definition

namespace helios::engine::mechanics::match::types { ... }

Typedefs Index

usingLivesRevision = uint32_t

Monotonically increasing counter tracking LivesComponent mutations. More...

usingMatchStateType = uint16_t

Underlying type for MatchState bitmask values. More...

Enumerations Index

enum classMatchState : MatchStateType { ... }

Enumeration of possible match states. More...

enum classMatchStateTransitionId : uint16_t { ... }

Enumeration of transition identifiers. More...

Operators Index

constexpr MatchStateoperator| (const MatchState lhs, const MatchState rhs) noexcept

Bitwise OR operator for combining match states. More...

constexpr MatchStateoperator& (const MatchState lhs, const MatchState rhs) noexcept

Bitwise AND operator for masking match states. More...

Functions Index

constexpr boolhasFlag (const MatchState mask, const MatchState flag) noexcept

Checks if a flag is set in a state mask. More...

Variables Index

constexpr size_tMatchStateTypeSize = 16

Description

Core types for match state management.

Contains enums, structs, and classes for state machine operations.

Typedefs

LivesRevision

using helios::engine::mechanics::match::types::LivesRevision = uint32_t

Monotonically increasing counter tracking LivesComponent mutations.

Observer systems compare their cached revision against the component's current revision to detect changes.

Definition at line 20 of file LivesRevision.ixx.

20 using LivesRevision = uint32_t;

MatchStateType

using helios::engine::mechanics::match::types::MatchStateType = uint16_t

Underlying type for MatchState bitmask values.

Definition at line 18 of file MatchState.ixx.

18 using MatchStateType = uint16_t;

Enumerations

MatchState

enum class helios::engine::mechanics::match::types::MatchState : MatchStateType
strong

Enumeration of possible match states.

Enumeration values
Undefined (= 0)
Warmup (= 1 << 0)
Start (= 1 << 1)
Countdown (= 1 << 2)
Playing (= 1 << 3)
PlayerDefeated (= 1 << 4)
GameOver (= 1 << 5)

States can be combined using bitwise operators for masking.

Definition at line 27 of file MatchState.ixx.

28
30
31 Warmup = 1 << 0,
32
33 Start = 1 << 1,
34
35 Countdown = 1 << 2,
36
37 Playing = 1 << 3,
38
39 PlayerDefeated = 1 << 4,
40
41 GameOver = 1 << 5
42
43 };

MatchStateTransitionId

enum class helios::engine::mechanics::match::types::MatchStateTransitionId : uint16_t
strong

Enumeration of transition identifiers.

Enumeration values
Undefined
WarmupRequest
StartRequest
QuitRequest
CountdownRequest
PlayerDied
PlayerSpawnRequest
GameOverRequest

Each identifier represents a specific type of match state transition request.

Definition at line 22 of file MatchStateTransitionId.ixx.

Operators

operator&()

MatchState helios::engine::mechanics::match::types::operator& (const MatchState lhs, const MatchState rhs)
nodiscard constexpr noexcept

Bitwise AND operator for masking match states.

Definition at line 55 of file MatchState.ixx.

55 [[nodiscard]] constexpr MatchState operator&(const MatchState lhs, const MatchState rhs) noexcept {
56 return static_cast<MatchState>(static_cast<MatchStateType>(lhs) & static_cast<MatchStateType>(rhs));
57 }

operator|()

MatchState helios::engine::mechanics::match::types::operator| (const MatchState lhs, const MatchState rhs)
nodiscard constexpr noexcept

Bitwise OR operator for combining match states.

Definition at line 48 of file MatchState.ixx.

48 [[nodiscard]] constexpr MatchState operator|(const MatchState lhs, const MatchState rhs) noexcept {
49 return static_cast<MatchState>(static_cast<MatchStateType>(lhs) | static_cast<MatchStateType>(rhs));
50 }

Functions

hasFlag()

bool helios::engine::mechanics::match::types::hasFlag (const MatchState mask, const MatchState flag)
nodiscard constexpr noexcept

Checks if a flag is set in a state mask.

Parameters
mask

The state mask to check.

flag

The flag to check for.

Returns

True if the flag is set in the mask.

Definition at line 66 of file MatchState.ixx.

66 [[nodiscard]] constexpr bool hasFlag(const MatchState mask, const MatchState flag) noexcept {
67 return (mask & flag) == flag;
68 }

Variables

MatchStateTypeSize

size_t helios::engine::mechanics::match::types::MatchStateTypeSize = 16
constexpr

Definition at line 20 of file MatchState.ixx.

20 constexpr size_t MatchStateTypeSize = 16;

The documentation for this namespace was generated from the following files:


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.