4#include "CardConstants.h"
7namespace Game::CardHelper
13 static bool IsStackInTableau(
const CardStack *stack)
15 return stack->GetBaseSize() > 0 && stack->GetBaseSize() < CardConstants::TableauSize;
22 static bool IsStackStock(
const CardStack *stack) {
return stack->GetBaseSize() == CardConstants::StockSize; }
28 static bool IsStackFoundation(
const CardStack *stack) {
return stack->GetBaseSize() == 0; }
34 static constexpr bool IsRed(CardColor color) {
return color == CardColor::Hearts || color == CardColor::Diamonds; }
40 static constexpr int8 GetCardValue(
const CardType type)
44 case CardType::Ace:
return 1;
45 case CardType::N2:
return 2;
46 case CardType::N3:
return 3;
47 case CardType::N4:
return 4;
48 case CardType::N5:
return 5;
49 case CardType::N6:
return 6;
50 case CardType::N7:
return 7;
51 case CardType::N8:
return 8;
52 case CardType::N9:
return 9;
53 case CardType::N10:
return 10;
54 case CardType::Jack:
return 11;
55 case CardType::Queen:
return 12;
56 case CardType::King:
return 13;
65 static bool IsOppositeColor(Card *left, Card *right)
67 return IsRed(left->Color.GetEnum()) != IsRed(right->Color.GetEnum());