2023-11-16 15:54:50 +01:00
|
|
|
#ifndef DYNAMIC_PROGRAM_MAKE_STATE_H
|
|
|
|
#define DYNAMIC_PROGRAM_MAKE_STATE_H
|
|
|
|
|
|
|
|
#include <optional>
|
|
|
|
|
|
|
|
#include "game_interface.h"
|
|
|
|
|
|
|
|
namespace Hanabi
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @brief Produces a game state from specified parms.
|
|
|
|
* @param num_suits: Has to be in [3,6]
|
|
|
|
* @param num_players Has to be in [2,6]
|
|
|
|
* @param deck A list of cards with at most as many suits as num_suits
|
|
|
|
* @param score_goal What is considered as an optimal score for this game state.
|
|
|
|
* If null, the maximum score is inserted
|
2024-01-09 02:21:01 +01:00
|
|
|
* @param num_clues_gained_on_discard_or_stack_finished The number of clues gained for discarding or playing a 5
|
2023-11-16 15:54:50 +01:00
|
|
|
* @return Pointer to created game state, wrapped into abstract interface
|
|
|
|
*
|
|
|
|
* @note Since the implementation of the actual game state (the concrete class derived from HanabiStateIF),
|
|
|
|
* is heavily templated, this function has its own header + source file to reduce compilation time
|
|
|
|
* for all components using this, since there is now only one place where the templated implementation
|
|
|
|
* is actually compiled and has not be recompiled upon other program parts changing.
|
|
|
|
*/
|
|
|
|
std::unique_ptr<Hanabi::HanabiStateIF> make_game_state(
|
|
|
|
std::size_t num_suits,
|
|
|
|
Hanabi::player_t num_players,
|
|
|
|
std::vector<Hanabi::Card> const &deck,
|
2024-01-09 02:21:01 +01:00
|
|
|
clue_t num_clues_gained_on_discard_or_stack_finished = clue_t(1),
|
2023-11-16 15:54:50 +01:00
|
|
|
std::optional<uint8_t> score_goal = std::nullopt
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif //DYNAMIC_PROGRAM_MAKE_STATE_H
|