GameStateStorage class
Cache-efficient game state storage using Boost flat containers.
Uses boost::container::flat_map and flat_set for better cache locality compared to standard node-based containers.
Public types
- using PlayerId = std::uint8_t
- using DiceCount = std::uint8_t
- using FaceValue = std::uint8_t
- using Points = std::uint8_t
- using PlayerDataMap = boost::container::flat_map<PlayerId, CompactGameState>
- using ActivePlayerSet = boost::container::flat_set<PlayerId>
Constructors, destructors, conversion operators
- GameStateStorage()
- ~GameStateStorage() defaulted
- GameStateStorage(const GameStateStorage&) deleted
- GameStateStorage(GameStateStorage&&) defaulted
Public functions
- auto operator=(const GameStateStorage&) -> GameStateStorage& deleted
- auto operator=(GameStateStorage&&) -> GameStateStorage& defaulted
- void store_player_state(PlayerId id, const CompactGameState& state)
- auto get_player_state(PlayerId id) const -> const CompactGameState*
- auto get_player_state(PlayerId id) -> CompactGameState*
- void add_active_player(PlayerId id)
- void remove_active_player(PlayerId id)
- auto is_player_active(PlayerId id) const -> bool
- auto get_active_players() const -> const ActivePlayerSet&
- void clear()
- auto size() const -> std::size_t
- auto memory_usage() const -> std::size_t