MCPcopy Create free account
hub / github.com/cuberite/cuberite / RegisterObjective

Method RegisterObjective

src/Scoreboard.cpp:285–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

283
284
285cObjective* cScoreboard::RegisterObjective(const AString & a_Name, const AString & a_DisplayName, cObjective::eType a_Type)
286{
287 cObjective Objective(a_Name, a_DisplayName, a_Type, m_World);
288
289 std::pair<cObjectiveMap::iterator, bool> Status = m_Objectives.insert(cNamedObjective(a_Name, Objective));
290
291 if (Status.second)
292 {
293 ASSERT(m_World != NULL);
294 m_World->BroadcastScoreboardObjective(a_Name, a_DisplayName, 0);
295
296 return &Status.first->second;
297 }
298 else
299 {
300 return NULL;
301 }
302}
303
304
305

Callers 1

LoadScoreboardFromNBTMethod · 0.80

Calls 1

Tested by

no test coverage detected