Cuberite
A lightweight, fast and extensible game server for Minecraft
|
#include <Scoreboard.h>
Public Types | |
enum | eType { otDummy , otDeathCount , otPlayerKillCount , otTotalKillCount , otHealth , otAchievement , otStat , otStatItemCraft , otStatItemUse , otStatItemBreak , otStatBlockMine , otStatEntityKill , otStatEntityKilledBy } |
typedef int | Score |
Public Member Functions | |
Score | AddScore (const AString &a_Name, Score a_Delta) |
Adds a_Delta and returns the new score. More... | |
cObjective (const AString &a_Name, const AString &a_DisplayName, eType a_Type, cWorld *a_World) | |
const AString & | GetDisplayName (void) const |
const AString & | GetName (void) const |
Score | GetScore (const AString &a_Name) const |
Returns the score of the specified player. More... | |
eType | GetType (void) const |
void | Reset (void) |
Resets the objective. More... | |
void | ResetScore (const AString &a_Name) |
Resets the score of the specified player. More... | |
void | SendTo (cClientHandle &a_Client) |
Send this objective to the specified client. More... | |
void | SetDisplayName (const AString &a_Name) |
void | SetScore (const AString &a_Name, Score a_Score) |
Sets the score of the specified player. More... | |
Score | SubScore (const AString &a_Name, Score a_Delta) |
Subtracts a_Delta and returns the new score. More... | |
Static Public Member Functions | |
static eType | StringToType (const AString &a_Name) |
static AString | TypeToString (eType a_Type) |
Private Types | |
typedef std::map< AString, Score > | cScoreMap |
typedef std::pair< AString, Score > | cTrackedPlayer |
Private Attributes | |
AString | m_DisplayName |
AString | m_Name |
cScoreMap | m_Scores |
eType | m_Type |
cWorld * | m_World |
Friends | |
class | cScoreboardSerializer |
Definition at line 31 of file Scoreboard.h.
|
private |
Definition at line 104 of file Scoreboard.h.
|
private |
Definition at line 102 of file Scoreboard.h.
typedef int cObjective::Score |
Definition at line 35 of file Scoreboard.h.
enum cObjective::eType |
Enumerator | |
---|---|
otDummy | |
otDeathCount | |
otPlayerKillCount | |
otTotalKillCount | |
otHealth | |
otAchievement | |
otStat | |
otStatItemCraft | |
otStatItemUse | |
otStatItemBreak | |
otStatBlockMine | |
otStatEntityKill | |
otStatEntityKilledBy |
Definition at line 37 of file Scoreboard.h.
cObjective::cObjective | ( | const AString & | a_Name, |
const AString & | a_DisplayName, | ||
cObjective::eType | a_Type, | ||
cWorld * | a_World | ||
) |
Definition at line 77 of file Scoreboard.cpp.
cObjective::Score cObjective::AddScore | ( | const AString & | a_Name, |
cObjective::Score | a_Delta | ||
) |
Adds a_Delta and returns the new score.
Definition at line 143 of file Scoreboard.cpp.
|
inline |
Definition at line 73 of file Scoreboard.h.
|
inline |
Definition at line 72 of file Scoreboard.h.
cObjective::Score cObjective::GetScore | ( | const AString & | a_Name | ) | const |
Returns the score of the specified player.
Definition at line 103 of file Scoreboard.cpp.
|
inline |
Definition at line 70 of file Scoreboard.h.
void cObjective::Reset | ( | void | ) |
Resets the objective.
Definition at line 89 of file Scoreboard.cpp.
void cObjective::ResetScore | ( | const AString & | a_Name | ) |
Resets the score of the specified player.
Definition at line 132 of file Scoreboard.cpp.
void cObjective::SendTo | ( | cClientHandle & | a_Client | ) |
Send this objective to the specified client.
Definition at line 182 of file Scoreboard.cpp.
void cObjective::SetDisplayName | ( | const AString & | a_Name | ) |
Definition at line 171 of file Scoreboard.cpp.
void cObjective::SetScore | ( | const AString & | a_Name, |
cObjective::Score | a_Score | ||
) |
Sets the score of the specified player.
Definition at line 121 of file Scoreboard.cpp.
|
static |
Definition at line 41 of file Scoreboard.cpp.
cObjective::Score cObjective::SubScore | ( | const AString & | a_Name, |
cObjective::Score | a_Delta | ||
) |
Subtracts a_Delta and returns the new score.
Definition at line 157 of file Scoreboard.cpp.
Definition at line 16 of file Scoreboard.cpp.
|
friend |
Definition at line 115 of file Scoreboard.h.
|
private |
Definition at line 108 of file Scoreboard.h.
|
private |
Definition at line 109 of file Scoreboard.h.
|
private |
Definition at line 106 of file Scoreboard.h.
|
private |
Definition at line 111 of file Scoreboard.h.
|
private |
Definition at line 113 of file Scoreboard.h.