MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / init

Method init

game/state/battle/ai/unitai.cpp:35–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35void AIBlockUnit::init(GameState &state, BattleUnit &u)
36{
37 // FIXME: Actually read this option
38 bool USER_OPTION_USE_HARDCORE_AI = false;
39
40 aiList.clear();
41 aiList.push_back(mksp<UnitAILowMorale>());
42 aiList.push_back(mksp<UnitAIDefault>());
43 aiList.push_back(mksp<UnitAIBehavior>());
44 // Even player units have AI because when they're taken control of they will need that
45 if (USER_OPTION_USE_HARDCORE_AI)
46 {
47 aiList.push_back(mksp<UnitAIHardcore>());
48 }
49 else
50 {
51 aiList.push_back(mksp<UnitAIVanilla>());
52 }
53
54 reset(state, u);
55}
56
57void AIBlockUnit::reset(GameState &state, BattleUnit &u)
58{

Callers 2

initBattleMethod · 0.45
placeUnitMethod · 0.45

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected