GameHistory class
Ring buffer-based game history with custom memory management.
Uses boost::circular_buffer for efficient history storage with automatic old entry removal.
Public types
- using HistoryAllocator = boost::pool_allocator<CompactGameState>
- using HistoryBuffer = boost::circular_buffer<CompactGameState, HistoryAllocator>
Public static variables
- static std::size_t DEFAULT_HISTORY_SIZE constexpr
Constructors, destructors, conversion operators
-
GameHistory(std::size_t max_entries = DEFAULT_
HISTORY_ SIZE) explicit - ~GameHistory() defaulted
Public functions
- void record_state(const CompactGameState& state)
- void record_state(CompactGameState&& state)
- auto get_state(std::size_t steps_back) const -> const CompactGameState*
- auto get_recent_states(std::size_t count) const -> std::span<const CompactGameState>
- auto size() const -> std::size_t
- auto empty() const -> bool
- auto get_dice_frequency(std::size_t last_n_states) const -> std::vector<std::uint8_t>
- auto get_average_dice_count(std::size_t last_n_states) const -> double
- void clear()
- void resize(std::size_t new_size)
- auto capacity() const -> std::size_t