Cockatrice
2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
Toggle main menu visibility
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 <QObject>
11
#include <QString>
12
#include <libcockatrice/protocol/pb/serverinfo_user.pb.h>
13
#include <qtmetamacros.h>
14
15
class
PlayerInfo
:
public
QObject
16
{
17
Q_OBJECT
18
public
:
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
PlayerInfo::userInfo
ServerInfo_User * userInfo
Definition
player_info.h:21
PlayerInfo::judge
bool judge
Definition
player_info.h:24
PlayerInfo::setLocal
void setLocal(bool _local)
Definition
player_info.h:35
PlayerInfo::getUserInfo
ServerInfo_User * getUserInfo() const
Definition
player_info.h:30
PlayerInfo::PlayerInfo
PlayerInfo(const ServerInfo_User &info, int id, bool local, bool judge)
Definition
player_info.cpp:5
PlayerInfo::getId
int getId() const
Definition
player_info.h:26
PlayerInfo::getName
QString getName() const
Definition
player_info.h:53
PlayerInfo::getLocal
bool getLocal() const
Definition
player_info.h:40
PlayerInfo::getLocalOrJudge
bool getLocalOrJudge() const
Definition
player_info.h:44
PlayerInfo::getJudge
bool getJudge() const
Definition
player_info.h:48
PlayerInfo::local
bool local
Definition
player_info.h:23
PlayerInfo::id
int id
Definition
player_info.h:22
ServerInfo_User
Definition
serverinfo_user.proto:2
ServerInfo_User::name
optional string name
Definition
serverinfo_user.proto:24
cockatrice
src
game
player
player_info.h
Generated by
1.18.0