refactor(game): make HandCard default-constructible

- Removed the constructor requiring an array of cards.
This commit is contained in:
Kieran Kihn
2025-11-17 21:14:36 +08:00
parent d5e1d7f03d
commit 091e5f33ca
2 changed files with 2 additions and 7 deletions

View File

@@ -9,12 +9,7 @@
#include <utility> #include <utility>
namespace UNO::GAME { namespace UNO::GAME {
HandCard::HandCard(const std::array<Card, 7> &cards) HandCard::HandCard() = default;
{
for (const auto &card : cards) {
cards_.insert(card);
}
}
const std::multiset<Card> &HandCard::getCards() const const std::multiset<Card> &HandCard::getCards() const
{ {

View File

@@ -23,7 +23,7 @@ namespace UNO::GAME {
std::multiset<Card> cards_; std::multiset<Card> cards_;
public: public:
explicit HandCard(const std::array<Card, 7> &cards); explicit HandCard();
/** /**
* 获得当前手牌 * 获得当前手牌