1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:17:35 +00:00

LibCards+Games: Change name of card type to card suit

Playing cards have a `suit` such as `hearts`/`diamonds`, not a
`type`. Make the internal naming consistent with the way playing cards
are typically named.
This commit is contained in:
Lenny Maiorani 2022-03-18 13:53:23 -06:00 committed by Linus Groh
parent 4c5e9f5633
commit a51fce6c0f
9 changed files with 78 additions and 78 deletions

View file

@ -90,7 +90,7 @@ void Game::timer_event(Core::TimerEvent&)
void Game::create_new_animation_card()
{
auto card = Card::construct(static_cast<Card::Type>(get_random_uniform(to_underlying(Card::Type::__Count))), get_random_uniform(Card::card_count));
auto card = Card::construct(static_cast<Card::Suit>(get_random_uniform(to_underlying(Card::Suit::__Count))), get_random_uniform(Card::card_count));
card->set_position({ get_random_uniform(Game::width - Card::width), get_random_uniform(Game::height / 8) });
int x_sgn = card->position().x() > (Game::width / 2) ? -1 : 1;
@ -163,10 +163,10 @@ void Game::setup(Mode mode)
on_undo_availability_change(false);
for (int i = 0; i < Card::card_count; ++i) {
m_new_deck.append(Card::construct(Card::Type::Clubs, i));
m_new_deck.append(Card::construct(Card::Type::Spades, i));
m_new_deck.append(Card::construct(Card::Type::Hearts, i));
m_new_deck.append(Card::construct(Card::Type::Diamonds, i));
m_new_deck.append(Card::construct(Card::Suit::Clubs, i));
m_new_deck.append(Card::construct(Card::Suit::Spades, i));
m_new_deck.append(Card::construct(Card::Suit::Hearts, i));
m_new_deck.append(Card::construct(Card::Suit::Diamonds, i));
}
for (uint8_t i = 0; i < 200; ++i)