From b5ca0c5369e0e52f7037f7235e813a12e4803178 Mon Sep 17 00:00:00 2001 From: pc9y8rffn <920448271@qq.com> Date: Wed, 19 Jun 2024 13:59:57 +0800 Subject: [PATCH] ADD file via upload --- Player.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Player.cpp diff --git a/Player.cpp b/Player.cpp new file mode 100644 index 0000000..ed3cc9d --- /dev/null +++ b/Player.cpp @@ -0,0 +1,24 @@ +#include "Player.h" + +void Player::addCardToHand(const Card& card) { + hand.push_back(card); +} + +void Player::removeCardFromHand(const Card& card) { + auto it = std::find(hand.begin(), hand.end(), card); + if (it != hand.end()) { + hand.erase(it); + } +} + +void Player::updateChips(int amount) { + chips += amount; +} + +const std::vector& Player::getHand() const { + return hand; +} + +int Player::getChips() const { + return chips; +} \ No newline at end of file