Cockatrice 2025-11-30-Development-2.11.0-beta.38
A cross-platform virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
player_info.h
Go to the documentation of this file.
1
6
7#ifndef COCKATRICE_PLAYER_INFO_H
8#define COCKATRICE_PLAYER_INFO_H
9
10#include "player_target.h"
11
12#include <QObject>
13#include <libcockatrice/protocol/pb/serverinfo_user.pb.h>
14
15class PlayerInfo : public QObject
16{
17 Q_OBJECT
18public:
19 PlayerInfo(const ServerInfo_User &info, int id, bool local, bool judge);
20
21 ServerInfo_User *userInfo;
22 int id;
23 bool local;
24 bool judge;
26
27 int getId() const
28 {
29 return id;
30 }
31 ServerInfo_User *getUserInfo() const
32 {
33 return userInfo;
34 }
35
36 void setLocal(bool _local)
37 {
38 local = _local;
39 }
40
41 bool getLocal() const
42 {
43 return local;
44 }
45 bool getLocalOrJudge() const
46 {
47 return local || judge;
48 }
49 bool getJudge() const
50 {
51 return judge;
52 }
53
54 void setHandVisible(bool _handVisible)
55 {
56 handVisible = _handVisible;
57 }
58
59 bool getHandVisible() const
60 {
61 return handVisible;
62 }
63
64 QString getName() const
65 {
66 return QString::fromStdString(userInfo->name());
67 }
68};
69
70#endif // COCKATRICE_PLAYER_INFO_H
void setHandVisible(bool _handVisible)
Definition player_info.h:54
ServerInfo_User * userInfo
Definition player_info.h:21
bool judge
Definition player_info.h:24
void setLocal(bool _local)
Definition player_info.h:36
ServerInfo_User * getUserInfo() const
Definition player_info.h:31
PlayerInfo(const ServerInfo_User &info, int id, bool local, bool judge)
Definition player_info.cpp:3
int getId() const
Definition player_info.h:27
QString getName() const
Definition player_info.h:64
bool getHandVisible() const
Definition player_info.h:59
bool getLocal() const
Definition player_info.h:41
bool handVisible
Definition player_info.h:25
bool getLocalOrJudge() const
Definition player_info.h:45
bool getJudge() const
Definition player_info.h:49
bool local
Definition player_info.h:23
int id
Definition player_info.h:22
TODO: Document this.