Game class
#include <liarsdice/core/game.hpp>
Public types
- enum class State { NOT_STARTED, WAITING_FOR_PLAYERS, IN_PROGRESS, ROUND_ENDED, GAME_OVER }
Constructors, destructors, conversion operators
- Game(const GameConfig& config = {}) explicit
Public functions
- void add_player(std::shared_ptr<Player> player)
- void remove_player(unsigned int player_id)
- auto get_player_count() const -> size_t
- auto get_players() const -> const std::vector<std::shared_ptr<Player>>&
- auto get_player(unsigned int id) const -> std::shared_ptr<Player>
- auto get_current_player() const -> std::shared_ptr<Player>
- void start_game()
- void start_round()
- void process_guess(const Guess& guess)
- void process_call_liar()
- void end_round()
- void end_game()
- auto get_state() const -> State
- auto is_game_active() const -> bool
- auto get_round_number() const -> unsigned int
- auto get_last_guess() const -> std::optional<Guess>
- auto get_total_dice_count() const -> size_t
- auto count_total_dice_with_value(unsigned int face_value) const -> size_t
- auto events() -> GameEvents&
- auto events() const -> const GameEvents&
- auto get_state_storage() const -> const GameStateStorage&
- auto get_history() const -> const GameHistory&
- auto is_valid_guess(const Guess& guess) const -> bool