MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / remove

Method remove

src/clientbase/GfxBlock.cpp:152–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150
151
152bool GfxBlock::remove(EventClient* ec) {
153 if (clients.empty()) {
154 return false;
155 }
156 EventClient* top = clients[0];
157 bool success = false;
158 for (size_t i = 0; i < clients.size(); i++) {
159 if (clients[i] == ec) {
160 clients.erase(clients.begin() + i);
161 success = true;
162 i--;
163 }
164 }
165 if (!clients.empty() && (clients[0] != top)) {
166 clients[0]->GotGfxBlock(type, id); // notify the new owner
167 }
168 return success;
169}
170
171
172//============================================================================//

Callers 5

RemoveClientMethod · 0.45
RemoveEventMethod · 0.45
clearPlayerBlocksFunction · 0.45
removeClientMethod · 0.45
setTargetMethod · 0.45

Calls 4

emptyMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
GotGfxBlockMethod · 0.45

Tested by

no test coverage detected