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

Method InsertEvent

src/clientbase/EventHandler.cpp:268–285  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

266
267
268bool EventHandler::InsertEvent(EventClient* ec, const std::string& ciName) {
269 if (clientSet.find(ec) == clientSet.end()) {
270 return false;
271 }
272 EventMap::iterator it = eventMap.find(ciName);
273 if (it == eventMap.end()) {
274 return false;
275 }
276 const EventInfo& ei = it->second;
277 EventClientList* ecList = ei.GetList();
278 if (ecList == NULL) {
279 return false;
280 }
281 if (!CanUseEvent(ec, ei)) {
282 return false;
283 }
284 return ecList->insert(ec);
285}
286
287
288bool EventHandler::RemoveEvent(EventClient* ec, const std::string& ciName) {

Callers 1

UpdateCallInMethod · 0.80

Calls 4

findMethod · 0.45
endMethod · 0.45
GetListMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected