INNER CODE UNIT · C
commands
acoto87/war1 · src/war_ai.c:101
WarAICommandList* commands = &customData->commands;
WarAICommandListInit(commands, wm_globalAllocator());
WarUnitType townHall = wu_getUnitTypeForRace(WAR_UNIT_TOWNHALL_HUMANS, aiPlayer->race);
WarAICommandListAdd(commands, wai_createUnitRequest(context, aiPlayer, townHall, 1));
WarAICommandListAdd(commands, wai_createWaitForUnit(context, aiPlayer, townHall, 1));
WarUnitType worker = wu_getUnitTypeForRace(WAR_UNIT_PEASANT, aiPlayer->race);
WarAICommandListAdd(commands, wai_createUnitRequest(context, aiPlayer, worker, 2));
WarAICommandListAdd(commands, wai_createWaitForUnit(context, aiPlayer, worker, 2));
WarAICommandListAdd(commands, wai_createUnitRequest(context, aiPlayer, worker, 2));
WarAICommandListAdd(commands, wai_createWaitForUnit(context, aiPlayer, worker, 4));
ai->customData = customData;
}
WarAICommand* wai_getNextAICommand(WarContext* context, WarPlayerInfo* aiPlayer)
{