MCPcopy Create free account
hub / github.com/bwapi/bwapi / processEvents

Method processEvents

bwapi/BWAPI/Source/BWAPI/GameEvents.cpp:499–530  ·  view source on GitHub ↗

---------------------------------------------- PROCESS EVENTS

Source from the content-addressed store, hash-verified

497 }
498 //---------------------------------------------- PROCESS EVENTS
499 void GameImpl::processEvents()
500 {
501 //This function translates events into AIModule callbacks
502 if ( !client || server.isConnected() )
503 return;
504 for (Event e : events)
505 {
506 static DWORD dwLastEventTime = 0;
507
508 // Reset event stopwatch
509 if ( tournamentAI )
510 {
511 this->lastEventTime = 0;
512 dwLastEventTime = GetTickCount();
513 }
514
515 // Send event to the AI Client module
516 SendClientEvent(client, e);
517
518 // continue if the tournament is not loaded
519 if ( !tournamentAI )
520 continue;
521
522 // Save the last event time
523 this->lastEventTime = GetTickCount() - dwLastEventTime;
524
525 // Send same event to the Tournament module for post-processing
526 isTournamentCall = true;
527 SendClientEvent(tournamentAI, e);
528 isTournamentCall = false;
529 } // foreach event
530 }
531}
532

Callers 1

updateMethod · 0.80

Calls 1

isConnectedMethod · 0.45

Tested by

no test coverage detected