summaryrefslogtreecommitdiffstats
path: root/src/Scoreboard.cpp
diff options
context:
space:
mode:
authorAlexander Harkness <me@bearbin.net>2024-11-02 22:27:47 +0100
committerAlexander Harkness <me@bearbin.net>2024-11-02 22:27:47 +0100
commitcb50ec10591c0e0e4b9915e642bc50d3d8d1fd0a (patch)
treef647b20e1823f1846af88e832cf82a4a02e96e69 /src/Scoreboard.cpp
parentImprove clang-format config file, remove automatically enforced code style from contrib guide. (diff)
downloadcuberite-clang-format-codebase.tar
cuberite-clang-format-codebase.tar.gz
cuberite-clang-format-codebase.tar.bz2
cuberite-clang-format-codebase.tar.lz
cuberite-clang-format-codebase.tar.xz
cuberite-clang-format-codebase.tar.zst
cuberite-clang-format-codebase.zip
Diffstat (limited to 'src/Scoreboard.cpp')
-rw-r--r--src/Scoreboard.cpp81
1 files changed, 43 insertions, 38 deletions
diff --git a/src/Scoreboard.cpp b/src/Scoreboard.cpp
index fad78210e..704c5cfbe 100644
--- a/src/Scoreboard.cpp
+++ b/src/Scoreboard.cpp
@@ -44,20 +44,19 @@ cObjective::eType cObjective::StringToType(const AString & a_Name)
{
eType m_Type;
const char * m_String;
- } TypeMap [] =
- {
- {otDummy, "dummy" },
- {otDeathCount, "deathCount" },
- {otPlayerKillCount, "playerKillCount" },
- {otTotalKillCount, "totalKillCount" },
- {otHealth, "health" },
- {otAchievement, "achievement" },
- {otStat, "stat" },
- {otStatItemCraft, "stat.craftItem" },
- {otStatItemUse, "stat.useItem" },
- {otStatItemBreak, "stat.breakItem" },
- {otStatBlockMine, "stat.mineBlock" },
- {otStatEntityKill, "stat.killEntity" },
+ } TypeMap[] = {
+ {otDummy, "dummy"},
+ {otDeathCount, "deathCount"},
+ {otPlayerKillCount, "playerKillCount"},
+ {otTotalKillCount, "totalKillCount"},
+ {otHealth, "health"},
+ {otAchievement, "achievement"},
+ {otStat, "stat"},
+ {otStatItemCraft, "stat.craftItem"},
+ {otStatItemUse, "stat.useItem"},
+ {otStatItemBreak, "stat.breakItem"},
+ {otStatBlockMine, "stat.mineBlock"},
+ {otStatEntityKill, "stat.killEntity"},
{otStatEntityKilledBy, "stat.entityKilledBy"}
};
for (size_t i = 0; i < ARRAYCOUNT(TypeMap); i++)
@@ -74,11 +73,13 @@ cObjective::eType cObjective::StringToType(const AString & a_Name)
-cObjective::cObjective(const AString & a_Name, const AString & a_DisplayName, cObjective::eType a_Type, cWorld * a_World)
- : m_DisplayName(a_DisplayName)
- , m_Name(a_Name)
- , m_Type(a_Type)
- , m_World(a_World)
+cObjective::cObjective(
+ const AString & a_Name,
+ const AString & a_DisplayName,
+ cObjective::eType a_Type,
+ cWorld * a_World
+) :
+ m_DisplayName(a_DisplayName), m_Name(a_Name), m_Type(a_Type), m_World(a_World)
{
}
@@ -194,15 +195,17 @@ void cObjective::SendTo(cClientHandle & a_Client)
cTeam::cTeam(
- const AString & a_Name, const AString & a_DisplayName,
- const AString & a_Prefix, const AString & a_Suffix
-)
- : m_AllowsFriendlyFire(true)
- , m_CanSeeFriendlyInvisible(false)
- , m_DisplayName(a_DisplayName)
- , m_Name(a_Name)
- , m_Prefix(a_Prefix)
- , m_Suffix(a_Suffix)
+ const AString & a_Name,
+ const AString & a_DisplayName,
+ const AString & a_Prefix,
+ const AString & a_Suffix
+) :
+ m_AllowsFriendlyFire(true),
+ m_CanSeeFriendlyInvisible(false),
+ m_DisplayName(a_DisplayName),
+ m_Name(a_Name),
+ m_Prefix(a_Prefix),
+ m_Suffix(a_Suffix)
{
}
@@ -270,7 +273,8 @@ size_t cTeam::GetNumPlayers(void) const
-cScoreboard::cScoreboard(cWorld * a_World) : m_World(a_World)
+cScoreboard::cScoreboard(cWorld * a_World) :
+ m_World(a_World)
{
for (int i = 0; i < static_cast<int>(dsCount); ++i)
{
@@ -282,7 +286,11 @@ cScoreboard::cScoreboard(cWorld * a_World) : m_World(a_World)
-cObjective * cScoreboard::RegisterObjective(const AString & a_Name, const AString & a_DisplayName, cObjective::eType a_Type)
+cObjective * cScoreboard::RegisterObjective(
+ const AString & a_Name,
+ const AString & a_DisplayName,
+ cObjective::eType a_Type
+)
{
cObjective Objective(a_Name, a_DisplayName, a_Type, m_World);
@@ -357,8 +365,10 @@ cObjective * cScoreboard::GetObjective(const AString & a_Name)
cTeam * cScoreboard::RegisterTeam(
- const AString & a_Name, const AString & a_DisplayName,
- const AString & a_Prefix, const AString & a_Suffix
+ const AString & a_Name,
+ const AString & a_DisplayName,
+ const AString & a_Prefix,
+ const AString & a_Suffix
)
{
auto [TeamIterator, TeamExists] = m_Teams.try_emplace(a_Name, a_Name, a_DisplayName, a_Prefix, a_Suffix);
@@ -420,7 +430,7 @@ AStringVector cScoreboard::GetTeamNames()
{
AStringVector TeamNames;
- for (const auto & Team: m_Teams)
+ for (const auto & Team : m_Teams)
{
TeamNames.push_back(Team.first);
}
@@ -602,8 +612,3 @@ size_t cScoreboard::GetNumTeams(void) const
{
return m_Teams.size();
}
-
-
-
-
-