Revert "add card orders to deck"

This reverts commit 8b42819704.
This commit is contained in:
Maximilian Keßler 2024-01-12 14:51:13 +01:00
parent 4ba61b0450
commit e18937c599
Signed by: max
GPG key ID: BCC5A619923C0BA5
2 changed files with 1 additions and 5 deletions

View file

@ -63,11 +63,10 @@ namespace Hanabi
{ {
suit_t suit; suit_t suit;
rank_t rank; rank_t rank;
uint8_t deck_index; /** Order of card in deck, numbered 0, 1, ... */
// These attributes are not needed in general for a card, // These attributes are not needed in general for a card,
// they represent internal states during backtracking. // they represent internal states during backtracking.
uint8_t local_index; /** Used for the local representation of the current game state. */ uint8_t local_index;
bool in_starting_hand; bool in_starting_hand;
bool initial_trash; bool initial_trash;

View file

@ -71,15 +71,12 @@ namespace Parsing
std::pair<std::vector<Hanabi::Card>, Hanabi::suit_t> parse_deck(const boost::json::value & deck_json) std::pair<std::vector<Hanabi::Card>, Hanabi::suit_t> parse_deck(const boost::json::value & deck_json)
{ {
auto deck = boost::json::value_to<std::vector<Hanabi::Card>>(deck_json); auto deck = boost::json::value_to<std::vector<Hanabi::Card>>(deck_json);
uint8_t deck_index = 0;
for (auto & card: deck) for (auto & card: deck)
{ {
ASSERT(card.rank < 5); ASSERT(card.rank < 5);
ASSERT(card.rank >= 0); ASSERT(card.rank >= 0);
ASSERT(card.suit < 6); ASSERT(card.suit < 6);
ASSERT(card.suit >= 0); ASSERT(card.suit >= 0);
card.deck_index = deck_index;
deck_index++;
} }
Hanabi::suit_t num_suits = 0; Hanabi::suit_t num_suits = 0;
for (const auto & card: deck) for (const auto & card: deck)