Cockatrice 2026-06-01-Development-3.1.0-beta.3
A 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;
25
26 int getId() const
27 {
28 return id;
29 }
30 ServerInfo_User *getUserInfo() const
31 {
32 return userInfo;
33 }
34
35 void setLocal(bool _local)
36 {
37 local = _local;
38 }
39
40 bool getLocal() const
41 {
42 return local;
43 }
44 bool getLocalOrJudge() const
45 {
46 return local || judge;
47 }
48 bool getJudge() const
49 {
50 return judge;
51 }
52
53 QString getName() const
54 {
55 return QString::fromStdString(userInfo->name());
56 }
57};
58
59#endif // COCKATRICE_PLAYER_INFO_H
ServerInfo_User * userInfo
Definition player_info.h:21
bool judge
Definition player_info.h:24
void setLocal(bool _local)
Definition player_info.h:35
ServerInfo_User * getUserInfo() const
Definition player_info.h:30
PlayerInfo(const ServerInfo_User &info, int id, bool local, bool judge)
Definition player_info.cpp:3
int getId() const
Definition player_info.h:26
QString getName() const
Definition player_info.h:53
bool getLocal() const
Definition player_info.h:40
bool getLocalOrJudge() const
Definition player_info.h:44
bool getJudge() const
Definition player_info.h:48
bool local
Definition player_info.h:23
int id
Definition player_info.h:22