$treeview $search $mathjax
Stratagus
2.2.6
$projectbrief
|
$projectbrief
|
$searchbox |
_________ __ __ / _____// |_____________ _/ |______ ____ __ __ ______ \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/ / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \ /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ > \/ \/ \//_____/ \/ ______________________ ______________________ T H E W A R B E G I N S Stratagus - A free fantasy real time strategy game engine
Go to the source code of this file.
ai.h - The ai headerfile. | |
int | AiSleepCycles |
void | AiEachCycle (CPlayer *player) |
Ai sleeps # cycles. | |
void | AiEachSecond (CPlayer *player) |
Called each game cycle. | |
void | InitAiModule () |
Called each second. | |
void | AiInit (CPlayer *player) |
Init AI global structures. | |
void | CleanAi () |
Init AI for this player. | |
void | FreeAi () |
Cleanup the AI module. | |
void | SaveAi (CFile *file) |
Free the AI resources. | |
void | AiCclRegister () |
Save the AI state. | |
void | AiAttackWithForceAt (unsigned int force, int x, int y) |
Register ccl features. | |
void | AiAttackWithForce (unsigned int force) |
Attack with force. | |
void | AiHelpMe (const CUnit *attacker, CUnit &defender) |
Called if AI unit is attacked. | |
void | AiUnitKilled (CUnit &unit) |
Called if AI unit is killed. | |
void | AiNeedMoreSupply (const CPlayer &player) |
Called if AI needs more farms. | |
void | AiWorkComplete (CUnit *unit, CUnit &what) |
Called if AI unit has completed work. | |
void | AiCanNotBuild (CUnit &unit, const CUnitType &what) |
Called if AI unit can't build. | |
void | AiCanNotReach (CUnit &unit, const CUnitType &what) |
Called if AI unit can't reach building place. | |
void | AiCanNotMove (CUnit &unit) |
Called if an AI unit can't move. | |
void | AiTrainingComplete (CUnit &unit, CUnit &what) |
Called if AI unit has completed training. | |
void | AiUpgradeToComplete (CUnit &unit, const CUnitType &what) |
Called if AI unit has completed upgrade to. | |
void | AiResearchComplete (CUnit &unit, const CUpgrade *what) |
Called if AI unit has completed research. |
void AiAttackWithForce | ( | unsigned int | force | ) |
Attack with force.
Attack opponent with force.
force | Force number to attack with. |
void AiAttackWithForceAt | ( | unsigned int | force, | |
int | x, | |||
int | y | |||
) |
Register ccl features.
Attack with force at position
Register ccl features.
Attack at position with force.
force | Force number to attack with. | |
x | X tile map position to be attacked. | |
y | Y tile map position to be attacked. |
Called if AI unit can't build.
Called if building can't be build.
unit | Pointer to unit what builds the building. | |
what | Pointer to unit-type. |
void AiCanNotMove | ( | CUnit & | unit | ) |
Called if an AI unit can't move.
Called if a unit can't move. Try to move unit in the way
unit | Pointer to unit what builds the building. |
Called if AI unit can't reach building place.
Called if building place can't be reached.
unit | Pointer to unit what builds the building. | |
what | Pointer to unit-type. |
void AiCclRegister | ( | ) |
Save the AI state.
Register CCL features for unit-type.
void AiEachCycle | ( | CPlayer * | player | ) |
Ai sleeps # cycles.
This is called for each player, each game cycle.
player | The player structure pointer. |
void AiEachSecond | ( | CPlayer * | player | ) |
Called each game cycle.
This is called for each player each second.
player | The player structure pointer. |
Called if AI unit is attacked.
Called if a Unit is Attacked
attacker | Pointer to attacker unit. | |
defender | Pointer to unit that is being attacked. |
void AiInit | ( | CPlayer * | player | ) |
Init AI global structures.
Setup all at start.
player | The player structure pointer. |
void AiNeedMoreSupply | ( | const CPlayer & | player | ) |
Called if AI needs more farms.
Called if the AI needs more farms.
player | player which need supply. |
Called if AI unit has completed research.
Called if reseaching of an unit is completed.
unit | Pointer to unit working. | |
what | Pointer to the new upgrade. |
Called if AI unit has completed training.
Called if training of a unit is completed.
unit | Pointer to unit making. | |
what | Pointer to new ready trained unit. |
void AiUnitKilled | ( | CUnit & | unit | ) |
Called if AI unit is killed.
Called if a unit is killed.
unit | Pointer to unit. |
Called if AI unit has completed upgrade to.
Called if upgrading of an unit is completed.
unit | Pointer to unit working. | |
what | Pointer to the new unit-type. |
Called if AI unit has completed work.
Called if work complete (Buildings).
unit | Pointer to unit that builds the building. | |
what | Pointer to unit building that was built. |
void CleanAi | ( | ) |
Init AI for this player.
Cleanup the AI in order to enable to restart a game.
void FreeAi | ( | ) |
Cleanup the AI module.
Free all AI resources.
void InitAiModule | ( | ) |
Called each second.
Initialize global structures of the AI
void SaveAi | ( | CFile * | file | ) |
Free the AI resources.
Save state of AI to file.
file | Output file. |
int AiSleepCycles |