![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
Include dependency graph for aiguard.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Macros | |
| #define | CHECK_GUARD(ait, guard) aiguard_check_guard(ait, guard) |
| #define | CHECK_CHARGE_UNIT(ait, charge) aiguard_check_charge_unit(ait, charge) |
Functions | |
| void | aiguard_check_guard (struct ai_type *ait, const struct unit *guard) |
| Do sanity checks on a guard, reporting error messages to the log if necessary. More... | |
| void | aiguard_check_charge_unit (struct ai_type *ait, const struct unit *charge) |
| Do sanity checks on a charge, reporting error messages to the log if necessary. More... | |
| void | aiguard_clear_charge (struct ai_type *ait, struct unit *guard) |
| Remove the assignment of a charge to a guard. More... | |
| void | aiguard_clear_guard (struct ai_type *ait, struct unit *charge) |
| Remove assignment of bodyguard for a unit. More... | |
| void | aiguard_assign_guard_unit (struct ai_type *ait, struct unit *charge, struct unit *guard) |
| Assign a bodyguard to a unit. More... | |
| void | aiguard_assign_guard_city (struct ai_type *ait, struct city *charge, struct unit *guard) |
| Assign a guard to a city. More... | |
| void | aiguard_request_guard (struct ai_type *ait, struct unit *punit) |
| Request a (new) bodyguard for the unit. More... | |
| bool | aiguard_wanted (struct ai_type *ait, struct unit *charge) |
| Has a unit requested a guard and not (yet) been provided with one? More... | |
| bool | aiguard_has_charge (struct ai_type *ait, struct unit *charge) |
| Has a charge unit been assigned to a guard? More... | |
| bool | aiguard_has_guard (struct ai_type *ait, struct unit *charge) |
| Has a guard been assigned to a charge? More... | |
| struct unit * | aiguard_guard_of (struct ai_type *ait, struct unit *charge) |
| Which unit, if any, is the body guard of a unit? Returns nullptr if the unit has not been assigned a guard. More... | |
| struct unit * | aiguard_charge_unit (struct ai_type *ait, struct unit *guard) |
| Which unit (if any) has a guard been assigned to? Returns nullptr if the unit is not the guard for a unit. More... | |
| struct city * | aiguard_charge_city (struct ai_type *ait, struct unit *guard) |
| Which city (if any) has a guard been assigned to? Returns nullptr if the unit is not a guard for a city. More... | |
| void | aiguard_update_charge (struct ai_type *ait, struct unit *guard) |
| Check whether the assignment of a guard is still sane, and fix and problems. More... | |
| #define CHECK_CHARGE_UNIT | ( | ait, | |
| charge | |||
| ) | aiguard_check_charge_unit(ait, charge) |
| #define CHECK_GUARD | ( | ait, | |
| guard | |||
| ) | aiguard_check_guard(ait, guard) |
Assign a guard to a city.
Definition at line 188 of file aiguard.cpp.
Referenced by dai_military_findjob(), and dai_unit_new_task().
Assign a bodyguard to a unit.
Assumes that a unit can have at most one guard.
Definition at line 165 of file aiguard.cpp.
Referenced by dai_military_findjob().
Which city (if any) has a guard been assigned to? Returns nullptr if the unit is not a guard for a city.
Definition at line 280 of file aiguard.cpp.
Referenced by dai_military_bodyguard(), dai_military_defend(), and dai_military_findjob().
Which unit (if any) has a guard been assigned to? Returns nullptr if the unit is not the guard for a unit.
Definition at line 270 of file aiguard.cpp.
Referenced by dai_military_bodyguard(), dai_military_findjob(), and dai_unit_bodyguard_move().
Do sanity checks on a charge, reporting error messages to the log if necessary.
Inconsistent references do not always indicate an error, because units can change owners (for example, because of civil war) outside the control of the AI code.
Definition at line 81 of file aiguard.cpp.
Do sanity checks on a guard, reporting error messages to the log if necessary.
Inconsistent references do not always indicate an error, because units can change owners (for example, because of civil war) outside the control of the AI code.
Definition at line 39 of file aiguard.cpp.
Remove the assignment of a charge to a guard.
Assumes that a unit can have at most one guard.
Definition at line 109 of file aiguard.cpp.
Referenced by aiguard_assign_guard_city(), aiguard_assign_guard_unit(), aiguard_update_charge(), dai_military_defend(), dai_unit_close(), and dai_unit_new_task().
Remove assignment of bodyguard for a unit.
Assumes that a unit can have at most one guard.
There is no analogous function for cities, because cities can have many guards: instead use aiguard_clear_charge for each city guard.
Definition at line 138 of file aiguard.cpp.
Referenced by aiguard_assign_guard_unit(), aiguard_request_guard(), dai_gothere_bodyguard(), and dai_unit_close().
Which unit, if any, is the body guard of a unit? Returns nullptr if the unit has not been assigned a guard.
Definition at line 260 of file aiguard.cpp.
Referenced by dai_gothere_bodyguard(), dai_manage_unit(), dai_unit_attack(), dai_unit_move(), and dai_unit_new_task().
Has a charge unit been assigned to a guard?
Definition at line 241 of file aiguard.cpp.
Referenced by dai_military_findjob().
Has a guard been assigned to a charge?
Definition at line 250 of file aiguard.cpp.
Referenced by dai_manage_unit(), and dai_military_findjob().
Request a (new) bodyguard for the unit.
Definition at line 218 of file aiguard.cpp.
Referenced by dai_gothere_bodyguard(), dai_manage_diplomat(), and dai_manage_unit().
Check whether the assignment of a guard is still sane, and fix and problems.
It was once sane, but might have been destroyed or become an enemy since.
Definition at line 291 of file aiguard.cpp.
Referenced by dai_military_findjob().
Has a unit requested a guard and not (yet) been provided with one?
Definition at line 232 of file aiguard.cpp.
Referenced by dai_military_findjob(), and look_for_charge().