mirror of
https://github.com/kierankihn/uno-game.git
synced 2025-12-27 02:13:18 +08:00
fix(game): update Player constructor to take std::string by value instead of reference
This commit is contained in:
@@ -45,7 +45,7 @@ namespace UNO::GAME {
|
||||
return cards_.empty();
|
||||
}
|
||||
|
||||
Player::Player(std::string &name) : name_(std::move(name)), handCard(nullptr) {}
|
||||
Player::Player(std::string name) : name_(std::move(name)), handCard(nullptr) {}
|
||||
|
||||
const std::string &Player::getName() const
|
||||
{
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace UNO::GAME {
|
||||
public:
|
||||
HandCard *handCard;
|
||||
|
||||
explicit Player(std::string &name);
|
||||
explicit Player(std::string name);
|
||||
|
||||
/**
|
||||
* @return 返回玩家名字
|
||||
|
||||
Reference in New Issue
Block a user