mirror of
https://github.com/kierankihn/uno-game.git
synced 2025-12-27 02:13:18 +08:00
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:
@@ -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_;
|
||||||
|
|||||||
Reference in New Issue
Block a user