mirror of
https://github.com/kierankihn/uno-game.git
synced 2025-12-27 02:13:18 +08:00
refactor(game): make HandCard default-constructible
- Removed the constructor requiring an array of cards.
This commit is contained in:
@@ -9,12 +9,7 @@
|
||||
#include <utility>
|
||||
|
||||
namespace UNO::GAME {
|
||||
HandCard::HandCard(const std::array<Card, 7> &cards)
|
||||
{
|
||||
for (const auto &card : cards) {
|
||||
cards_.insert(card);
|
||||
}
|
||||
}
|
||||
HandCard::HandCard() = default;
|
||||
|
||||
const std::multiset<Card> &HandCard::getCards() const
|
||||
{
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace UNO::GAME {
|
||||
std::multiset<Card> cards_;
|
||||
|
||||
public:
|
||||
explicit HandCard(const std::array<Card, 7> &cards);
|
||||
explicit HandCard();
|
||||
|
||||
/**
|
||||
* 获得当前手牌
|
||||
|
||||
Reference in New Issue
Block a user