/** ** This is called for each player each second. ** ** @param player The player structure pointer. */ void AiEachSecond(CPlayer &player) { AiPlayer = player.Ai; #ifdef DEBUG if (!AiPlayer) { return; } #endif // Advance script AiExecuteScript(); // Look if everything is fine. AiCheckUnits(); // Handle the resource manager. AiResourceManager(); // Handle the force manager. AiForceManager(); // Check for magic actions. AiCheckMagic(); // At most 1 explorer each 5 seconds if (GameCycle > AiPlayer->LastExplorationGameCycle + 5 * CYCLES_PER_SECOND) { AiSendExplorers(); } }
/** ** This is called for each player each second. ** ** @param player The player structure pointer. */ void AiEachSecond(CPlayer *player) { AiPlayer = player->Ai; Assert(AiPlayer != NULL); // Advance script AiExecuteFunction("EachSecond"); // Look if everything is fine. AiCheckUnits(); // Handle the resource manager. AiResourceManager(); // Handle the force manager. AiForceManager(); // Check for magic actions. AiCheckMagic(); }