Add check for draw pile size
This commit is contained in:
parent
9c1cb5ff4e
commit
e602f2a41a
1 changed files with 6 additions and 0 deletions
|
@ -537,6 +537,12 @@ namespace Hanabi
|
||||||
template<suit_t num_suits, player_t num_players, hand_index_t hand_size>
|
template<suit_t num_suits, player_t num_players, hand_index_t hand_size>
|
||||||
void HanabiState<num_suits, num_players, hand_size>::init_backtracking_information()
|
void HanabiState<num_suits, num_players, hand_size>::init_backtracking_information()
|
||||||
{
|
{
|
||||||
|
if (_weighted_draw_pile_size > 20)
|
||||||
|
{
|
||||||
|
std::stringstream ss;
|
||||||
|
ss << "Detected draw pile size of " << +_weighted_draw_pile_size << " is too big, can at most be 20.";
|
||||||
|
throw std::runtime_error(ss.str());
|
||||||
|
}
|
||||||
ASSERT(not _relative_representation.initialized);
|
ASSERT(not _relative_representation.initialized);
|
||||||
// Note that this function does not have to be particularly performant, we only call it once to initialize.
|
// Note that this function does not have to be particularly performant, we only call it once to initialize.
|
||||||
const Card trash = [this]() -> Card {
|
const Card trash = [this]() -> Card {
|
||||||
|
|
Loading…
Reference in a new issue