feat(game): update card comparison to exclude wild cards

- Adjusted `<` operator to properly handle `WILD` and `WILDDRAWFOUR` types during comparison.
This commit is contained in:
Kieran Kihn
2025-12-10 22:31:43 +08:00
parent d8d39f713d
commit a3b6117580

View File

@@ -66,7 +66,8 @@ namespace UNO::GAME {
bool Card::operator<(const Card &other) const bool Card::operator<(const Card &other) const
{ {
if (this->color_ != other.color_) { if (this->color_ != other.color_ && this->type_ != CardType::WILD && this->type_ != CardType::WILDDRAWFOUR
&& other.type_ != CardType::WILD && other.type_ != CardType::WILDDRAWFOUR) {
return this->color_ < other.color_; return this->color_ < other.color_;
} }
return this->type_ < other.type_; return this->type_ < other.type_;