From 4420552a843d5e9c6e2d8d2ace0445db7f67e0d1 Mon Sep 17 00:00:00 2001 From: Kieran Kihn <114803508+kierankihn@users.noreply.github.com> Date: Wed, 10 Dec 2025 21:44:05 +0800 Subject: [PATCH] feat(game): add `getSelfId` method to `ClientGameState` --- src/game/GameState.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/game/GameState.h b/src/game/GameState.h index 9a9665e..5e91b90 100644 --- a/src/game/GameState.h +++ b/src/game/GameState.h @@ -318,16 +318,23 @@ namespace UNO::GAME { public: ClientGameState(); - /** - * 设置玩家名字 - */ - void setPlayerName(const std::string &name); /** * 获取当前玩家的名字 * @return 玩家名字 */ [[nodiscard]] std::string getPlayerName() const; + /** + * 设置玩家名字 + */ + void setPlayerName(const std::string &name); + + /** + * 获取客户端对应的玩家 ID + * @return 客户端对应的玩家 ID + */ + [[nodiscard]] size_t getSelfId() const; + /** * 获得当前手牌 * @return 当前手牌的集合