adjust getter method for games to start turn counting at 1

This commit is contained in:
Maximilian Keßler 2023-08-12 20:10:28 +02:00
parent 849c0a6538
commit 78a703434d
Signed by: max
GPG key ID: BCC5A619923C0BA5

View file

@ -98,12 +98,12 @@ namespace Download {
std::unique_ptr<Hanabi::HanabiStateIF> produce_state( std::unique_ptr<Hanabi::HanabiStateIF> produce_state(
const std::vector<Hanabi::Card>& deck, const std::vector<Hanabi::Card>& deck,
const std::vector<Action>& actions, const std::vector<Action>& actions,
size_t num_turns_to_replicate, size_t start_turn,
size_t draw_pile_break = 0 size_t draw_pile_break = 0
) { ) {
auto game = std::unique_ptr<Hanabi::HanabiStateIF>(new Hanabi::HanabiState<num_suits, num_players, hand_size>(deck)); auto game = std::unique_ptr<Hanabi::HanabiStateIF>(new Hanabi::HanabiState<num_suits, num_players, hand_size>(deck));
std::uint8_t index; std::uint8_t index;
for (size_t i = 0; i < std::min(num_turns_to_replicate, actions.size()); i++) { for (size_t i = 0; i < std::min(start_turn - 1, actions.size()); i++) {
if (game->draw_pile_size() == draw_pile_break) { if (game->draw_pile_size() == draw_pile_break) {
break; break;
} }