change some types
This commit is contained in:
parent
38e99cf662
commit
849c0a6538
1 changed files with 14 additions and 14 deletions
|
@ -25,14 +25,14 @@ namespace Hanabi {
|
|||
using hand_index_t = std::uint8_t;
|
||||
using probability_t = boost::rational<unsigned long>;
|
||||
|
||||
/**
|
||||
* We will generally assume that stacks are played from n to 0
|
||||
* Playing a 0 will yield a clue
|
||||
* Therefore, for the default hanabi, we will play 4,3,2,1,0 in that order
|
||||
* on each stack. A stack with no cards played implicitly has value 5 on it
|
||||
* This is just easier to implement, since then the remaining number of cards
|
||||
* to be played is always the current number of the stack
|
||||
*/
|
||||
/**
|
||||
* We will generally assume that stacks are played from n to 0
|
||||
* Playing a 0 will yield a clue
|
||||
* Therefore, for the default hanabi, we will play 4,3,2,1,0 in that order
|
||||
* on each stack. A stack with no cards played implicitly has value 5 on it
|
||||
* This is just easier to implement, since then the remaining number of cards
|
||||
* to be played is always the current number of the stack
|
||||
*/
|
||||
constexpr rank_t starting_card_rank = 5;
|
||||
constexpr suit_t max_suit_index = 5;
|
||||
constexpr size_t max_card_duplicity = 3;
|
||||
|
@ -129,7 +129,7 @@ struct CardMultiplicity {
|
|||
Card card;
|
||||
unsigned multiplicity;
|
||||
|
||||
auto operator<=>(const CardMultiplicity &) const = default;
|
||||
bool operator==(const CardMultiplicity &) const = default;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
|
@ -163,7 +163,7 @@ private:
|
|||
std::array<inner_array_t , num_suits> _array {};
|
||||
};
|
||||
|
||||
enum class ActionType {
|
||||
enum class ActionType : std::uint8_t {
|
||||
play = 0,
|
||||
discard = 1,
|
||||
clue = 2,
|
||||
|
@ -302,15 +302,15 @@ private:
|
|||
// Card positions of these cards. Indexes correspond to the cards stored in _good_cards_draw vector
|
||||
boost::container::static_vector<boost::container::static_vector<player_t, max_card_duplicity>, 30> card_positions_draw;
|
||||
|
||||
// Note this is not the same as _good_cards_draw.size(), since this accounts for multiplicities
|
||||
size_t initial_draw_pile_size {};
|
||||
|
||||
// This will indicate whether cards that were in hands initially still are in hand
|
||||
// The first n bits are used and cards are assumed to have been marked with their indices in this bitset
|
||||
std::bitset<num_players * hand_size> card_positions_hands {};
|
||||
|
||||
// Note this is not the same as _good_cards_draw.size(), since this accounts for multiplicities
|
||||
std::uint8_t initial_draw_pile_size { 0 };
|
||||
|
||||
// Number of bits from above bitset that is meaningful
|
||||
size_t num_useful_cards_in_starting_hands { 0 };
|
||||
std::uint8_t num_useful_cards_in_starting_hands { 0 };
|
||||
|
||||
// Whether we initialized the values above and marked cards accordingly
|
||||
bool initialized { false };
|
||||
|
|
Loading…
Reference in a new issue