liarsdice::core::CompactGameState struct

Compact game state representation using bit manipulation.

Uses bitset and bit packing to minimize memory footprint while maintaining fast access to game state data.

Public types

struct LastAction
struct PlayerState

Public static variables

static std::size_t MAX_DICE constexpr
static std::size_t DICE_BITS constexpr
static std::size_t TOTAL_DICE_BITS constexpr

Public static functions

static auto deserialize(std::uint32_t data) -> CompactGameState

Public functions

void set_dice_value(std::size_t index, std::uint8_t value)
auto get_dice_value(std::size_t index) const -> std::uint8_t
auto get_all_dice() const -> std::array<std::uint8_t, MAX_DICE>
void set_all_dice(std::span<const std::uint8_t> dice)
auto is_eliminated() const -> bool
auto total_size() const -> std::size_t
auto serialize() const -> std::uint32_t

Public variables

std::uint16_t dice_bits
struct liarsdice::core::CompactGameState::PlayerState player_state
struct liarsdice::core::CompactGameState::LastAction last_action