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

Method DoWithPlayer

src/World.cpp:2401–2414  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2399
2400
2401bool cWorld::DoWithPlayer(const AString & a_PlayerName, cPlayerListCallback & a_Callback)
2402{
2403 // Calls the callback for each player in the list
2404 cCSLock Lock(m_CSPlayers);
2405 for (cPlayerList::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
2406 {
2407 if (NoCaseCompare((*itr)->GetName(), a_PlayerName) == 0)
2408 {
2409 a_Callback.Item(*itr);
2410 return true;
2411 }
2412 } // for itr - m_Players[]
2413 return false;
2414}
2415
2416
2417

Callers 1

TickFollowPlayerMethod · 0.80

Calls 5

NoCaseCompareFunction · 0.85
beginMethod · 0.80
endMethod · 0.80
GetNameMethod · 0.45
ItemMethod · 0.45

Tested by

no test coverage detected