_________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
                   Stratagus - A free fantasy real time strategy game engine

ai_local.h
Go to the documentation of this file.
1 // _________ __ __
2 // / _____// |_____________ _/ |______ ____ __ __ ______
3 // \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/
4 // / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ |
5 // /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ >
6 // \/ \/ \//_____/ \/
7 // ______________________ ______________________
8 // T H E W A R B E G I N S
9 // Stratagus - A free fantasy real time strategy game engine
10 //
12 //
13 // (c) Copyright 2000-2005 by Lutz Sammer and Antonis Chaniotis.
14 //
15 // This program is free software; you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation; only version 2 of the License.
18 //
19 // This program is distributed in the hope that it will be useful,
20 // but WITHOUT ANY WARRANTY; without even the implied warranty of
21 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 // GNU General Public License for more details.
23 //
24 // You should have received a copy of the GNU General Public License
25 // along with this program; if not, write to the Free Software
26 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
27 // 02111-1307, USA.
28 //
29 
30 #ifndef __AI_LOCAL_H__
31 #define __AI_LOCAL_H__
32 
34 
35 /*----------------------------------------------------------------------------
36 -- Includes
37 ----------------------------------------------------------------------------*/
38 
39 #include <vector>
40 
41 #include "upgrade_structs.h" // MaxCost
42 #include "unit_cache.h"
43 #include "vec2i.h"
44 
45 /*----------------------------------------------------------------------------
46 -- Declarations
47 ----------------------------------------------------------------------------*/
48 
49 class CUnit;
50 class CUnitType;
51 class CUpgrade;
52 class CPlayer;
53 
57 class CAiType
58 {
59 public:
60  CAiType() {}
61 
62  std::string Name;
63  std::string Race;
64  std::string Class;
65  std::string Script;
66 };
67 
72 {
73 public:
74  AiRequestType() : Count(0), Type(NULL) {}
75 
76  unsigned int Count;
78 };
79 
84 {
85 public:
86  AiUnitType() : Want(0), Type(NULL) {}
87 
88  unsigned int Want;
90 };
91 
99 };
100 
108 };
109 
110 #define AI_WAIT_ON_RALLY_POINT 60
111 
112 
117 class AiForce
118 {
119  friend class AiForceManager;
120 public:
122  Completed(false), Defending(false), Attacking(false),
125  {
126  HomePos.x = HomePos.y = GoalPos.x = GoalPos.y = -1;
127  }
128 
129  void Remove(CUnit &unit)
130  {
131  if (Units.Remove(&unit)) {
132  InternalRemoveUnit(&unit);
133  }
134  }
135 
139  void Reset(bool types = false)
140  {
141  FormerForce = -1;
142  Completed = false;
143  Defending = false;
144  Attacking = false;
146  if (types) {
147  UnitTypes.clear();
149  } else {
151  }
152  Units.for_each(InternalRemoveUnit);
153  Units.clear();
154  HomePos.x = HomePos.y = GoalPos.x = GoalPos.y = -1;
155  }
156  inline size_t Size() const { return Units.size(); }
157 
158  inline bool IsAttacking() const { return (!Defending && Attacking); }
159 
160  void Attack(const Vec2i &pos);
161  void RemoveDeadUnit();
162  int PlanAttack();
163 
164  void ReturnToHome();
165  bool NewRallyPoint(const Vec2i &startPos, Vec2i *resultPos);
166  void Insert(CUnit &unit);
167 
168 private:
169  void CountTypes(unsigned int *counter, const size_t len);
170  bool IsBelongsTo(const CUnitType &type);
171 
172  void Update();
173 
174  static void InternalRemoveUnit(CUnit *unit);
175 
176 public:
177  bool Completed;
178  bool Defending;
179  bool Attacking;
181 
182  std::vector<AiUnitType> UnitTypes;
184 
185  // If attacking
191 };
192 
193 // forces
194 #define AI_MAX_FORCES 50
195 #define AI_MAX_FORCE_INTERNAL (AI_MAX_FORCES / 2)
196 
197 
203 {
204 public:
205  AiForceManager();
206 
207  inline size_t Size() const { return forces.size(); }
208 
209  const AiForce &operator[](unsigned int index) const { return forces[index]; }
210  AiForce &operator[](unsigned int index) { return forces[index]; }
211 
212  int getIndex(AiForce *force) const
213  {
214  for (unsigned int i = 0; i < forces.size(); ++i) {
215  if (force == &forces[i]) {
216  return i;
217  }
218  }
219  return -1;
220  }
221 
222  unsigned int getScriptForce(unsigned int index)
223  {
224  if (script[index] == -1) {
225  script[index] = FindFreeForce();
226  }
227  return script[index];
228  }
229 
230  int GetForce(const CUnit &unit);
231  void RemoveDeadUnit();
232  bool Assign(CUnit &unit, int force = -1);
233  void Update();
234  unsigned int FindFreeForce(AiForceRole role = AiForceRoleDefault, int begin = 0);
235  void CheckUnits(int *counter);
236 private:
237  std::vector<AiForce> forces;
238  char script[AI_MAX_FORCES];
239 };
240 
247 {
248 public:
249  AiBuildQueue() : Want(0), Made(0), Type(NULL), Wait(0)
250  {
251  Pos.x = Pos.y = -1;
252  }
253 
254 public:
255  unsigned int Want;
256  unsigned int Made;
258  unsigned long Wait;
260 };
261 
266 {
267 public:
268  AiExplorationRequest(const Vec2i &pos, int mask) : pos(pos), Mask(mask) {}
269 
270 public:
272  int Mask;
273 };
274 
278 class PlayerAi
279 {
280 public:
281  PlayerAi() : Player(NULL), AiType(NULL),
282  SleepCycles(0), NeededMask(0), NeedSupply(false),
285  {
286  memset(Reserve, 0, sizeof(Reserve));
287  memset(Used, 0, sizeof(Used));
288  memset(Needed, 0, sizeof(Needed));
289  memset(Collect, 0, sizeof(Collect));
290  }
291 
292 public:
295  // controller
296  std::string Script;
297  unsigned long SleepCycles;
298 
300 
301  // resource manager
303  int Used[MaxCosts];
307  bool NeedSupply;
308  bool ScriptDebug;
309  bool BuildDepots;
310 
311  std::vector<AiExplorationRequest> FirstExplorationRequest;
312  unsigned long LastExplorationGameCycle;
313  unsigned long LastCanNotMoveGameCycle;
314  std::vector<AiRequestType> UnitTypeRequests;
315  std::vector<CUnitType *> UpgradeToRequests;
316  std::vector<CUpgrade *> ResearchRequests;
317  std::vector<AiBuildQueue> UnitTypeBuilt;
319 };
320 
328 class AiHelper
329 {
330 public:
335  std::vector<std::vector<CUnitType *> > &Train();
340  std::vector<std::vector<CUnitType *> > &Build();
345  std::vector<std::vector<CUnitType *> > &Upgrade();
352  std::vector<std::vector<CUnitType *> > &Research();
359  std::vector<std::vector<CUnitType *> > &SingleResearch();
364  std::vector<std::vector<CUnitType *> > &Repair();
369  std::vector<std::vector<CUnitType *> > &UnitLimit();
374  std::vector<std::vector<CUnitType *> > &Equiv();
375 
380  std::vector<std::vector<CUnitType *> > &Refinery();
381 
386  std::vector<std::vector<CUnitType *> > &Depots();
387 };
388 
389 /*----------------------------------------------------------------------------
390 -- Variables
391 ----------------------------------------------------------------------------*/
392 
393 extern std::vector<CAiType *> AiTypes;
394 extern AiHelper AiHelpers;
395 
396 extern int UnitTypeEquivs[UnitTypeMax + 1];
397 extern PlayerAi *AiPlayer;
398 
399 /*----------------------------------------------------------------------------
400 -- Functions
401 ----------------------------------------------------------------------------*/
402 
403 //
404 // Resource manager
405 //
407 extern void AiAddUnitTypeRequest(CUnitType &type, int count);
409 extern void AiAddUpgradeToRequest(CUnitType &type);
411 extern void AiAddResearchRequest(CUpgrade *upgrade);
413 extern void AiResourceManager();
415 extern void AiExplore(const Vec2i &pos, int exploreMask);
417 extern void AiNewUnitTypeEquiv(const CUnitType &a, const CUnitType &b);
419 extern void AiResetUnitTypeEquiv();
421 extern int AiFindUnitTypeEquiv(const CUnitType &type, int *result);
423 extern int AiFindAvailableUnitTypeEquiv(const CUnitType &type, int *result);
424 extern int AiGetBuildRequestsCount(const PlayerAi &pai, int (&counter)[UnitTypeMax]);
425 
426 extern void AiNewDepotRequest(CUnit &worker);
427 extern CUnit *AiGetSuitableDepot(const CUnit &worker, const CUnit &oldDepot, CUnit **resUnit);
428 
429 //
430 // Buildings
431 //
433 extern bool AiFindBuildingPlace(const CUnit &worker, const CUnitType &type, const Vec2i &nearPos, Vec2i *resultPos);
434 
435 //
436 // Forces
437 //
439 extern void AiRemoveDeadUnitInForces();
441 extern bool AiAssignToForce(CUnit &unit);
443 extern void AiAssignFreeUnitsToForce(int force = -1);
445 extern void AiAttackWithForceAt(unsigned int force, int x, int y);
447 extern void AiAttackWithForce(unsigned int force);
449 extern void AiAttackWithForces(int *forces);
450 
452 extern void AiForceManager();
453 
454 //
455 // Plans
456 //
458 extern int AiFindWall(AiForce *force);
461 extern void AiSendExplorers();
463 extern bool AiEnemyUnitsInDistance(const CPlayer &player, const CUnitType *type,
464  const Vec2i &pos, unsigned range);
465 
466 //
467 // Magic
468 //
470 extern void AiCheckMagic();
471 
473 
474 #endif // !__AI_LOCAL_H__
AiHelper::Equiv
std::vector< std::vector< CUnitType * > > & Equiv()
Definition: ai.cpp:1086
CPlayer
Diplomacy states for CommandDiplomacy.
Definition: player.h:83
PlayerAi::Used
int Used[MaxCosts]
Resources to keep in reserve.
Definition: ai_local.h:303
PlayerAi::LastCanNotMoveGameCycle
unsigned long LastCanNotMoveGameCycle
When did the last explore occur?
Definition: ai_local.h:313
AiAddResearchRequest
void AiAddResearchRequest(CUpgrade *upgrade)
Add research request to resource manager.
Definition: ai_resource.cpp:741
AiForce::AiForce
AiForce()
Definition: ai_local.h:121
AiBuildQueue::Type
CUnitType * Type
built number
Definition: ai_local.h:257
AiForce::Size
size_t Size() const
Definition: ai_local.h:156
AiPlayer
PlayerAi * AiPlayer
equivalence between unittypes
Definition: ai.cpp:167
MaxCosts
@ MaxCosts
resource 6
Definition: upgrade_structs.h:70
PlayerAi::Player
CPlayer * Player
Definition: ai_local.h:293
AiTypes
std::vector< CAiType * > AiTypes
Ai sleeps # cycles.
Definition: ai.cpp:164
AiNewDepotRequest
void AiNewDepotRequest(CUnit &worker)
Definition: ai_resource.cpp:358
CUnitCache::clear
void clear()
Definition: unit_cache.h:61
AiForceAttackingState_Boarding
@ AiForceAttackingState_Boarding
Definition: ai_local.h:104
PlayerAi::UpgradeToRequests
std::vector< CUnitType * > UpgradeToRequests
unit-types to build/train request,priority list
Definition: ai_local.h:315
PlayerAi::UnitTypeRequests
std::vector< AiRequestType > UnitTypeRequests
Last can not move cycle.
Definition: ai_local.h:314
CUnitCache
Definition: unit_cache.h:50
AiForceManager::GetForce
int GetForce(const CUnit &unit)
Definition: ai_force.cpp:591
AI_WAIT_ON_RALLY_POINT
#define AI_WAIT_ON_RALLY_POINT
Definition: ai_local.h:110
PlayerAi
Definition: ai_local.h:278
AiBuildQueue::Pos
Vec2i Pos
wait until this cycle
Definition: ai_local.h:259
AiFindAvailableUnitTypeEquiv
int AiFindAvailableUnitTypeEquiv(const CUnitType &type, int *result)
Finds all available equivalents units to a given one, in the preferred order.
Definition: ai_force.cpp:279
AiForceRole
AiForceRole
Definition: ai_local.h:95
AiAttackWithForceAt
void AiAttackWithForceAt(unsigned int force, int x, int y)
Attack with force at position.
Definition: ai_force.cpp:742
AiHelper::Train
std::vector< std::vector< CUnitType * > > & Train()
Definition: ai.cpp:1044
PlayerAi::Needed
int Needed[MaxCosts]
Used resources.
Definition: ai_local.h:304
UnitTypeEquivs
int UnitTypeEquivs[UnitTypeMax+1]
AI helper variables.
Definition: ai_force.cpp:197
AiUnitType
Definition: ai_local.h:83
AiForceRoleDefault
@ AiForceRoleDefault
Definition: ai_local.h:96
AiSendExplorers
void AiSendExplorers()
Definition: ai_plan.cpp:503
AiAttackWithForces
void AiAttackWithForces(int *forces)
Attack with forces in array.
Definition: ai_force.cpp:809
AiBuildQueue::Wait
unsigned long Wait
unit-type
Definition: ai_local.h:258
AiForce::Defending
bool Defending
Flag saying force is complete build.
Definition: ai_local.h:178
AiExplorationRequest::pos
Vec2i pos
Definition: ai_local.h:271
AiNewUnitTypeEquiv
void AiNewUnitTypeEquiv(const CUnitType &a, const CUnitType &b)
Make two unittypes be considered equals.
Definition: ai_force.cpp:219
AiForceRoleDefend
@ AiForceRoleDefend
Force should attack.
Definition: ai_local.h:98
AiForceRoleAttack
@ AiForceRoleAttack
So default is attacking.
Definition: ai_local.h:97
PlayerAi::LastRepairBuilding
int LastRepairBuilding
What the resource manager should build.
Definition: ai_local.h:318
AiForceManager::RemoveDeadUnit
void RemoveDeadUnit()
Definition: ai_force.cpp:610
vec2i.h
AiForce::NewRallyPoint
bool NewRallyPoint(const Vec2i &startPos, Vec2i *resultPos)
Definition: ai_force.cpp:419
CUnitCache::for_each
void for_each(const _T functor)
Apply a function to every element of a cache.
Definition: unit_cache.h:102
Vec2T::y
T y
Definition: vec2i.h:43
AiForce
Definition: ai_local.h:117
AiUnitType::Want
unsigned int Want
Definition: ai_local.h:88
AiForceManager::FindFreeForce
unsigned int FindFreeForce(AiForceRole role=AiForceRoleDefault, int begin=0)
Definition: ai_force.cpp:568
PlayerAi::LastExplorationGameCycle
unsigned long LastExplorationGameCycle
Requests for exploration.
Definition: ai_local.h:312
AiResourceManager
void AiResourceManager()
Periodic called resource manager handler.
Definition: ai_resource.cpp:1486
AiGetSuitableDepot
CUnit * AiGetSuitableDepot(const CUnit &worker, const CUnit &oldDepot, CUnit **resUnit)
Definition: ai_resource.cpp:467
AiForce::Attacking
bool Attacking
Flag saying force is defending.
Definition: ai_local.h:179
CUnitType
Definition: unittype.h:508
AiRequestType::Type
CUnitType * Type
elements in table
Definition: ai_local.h:77
CAiType::Script
std::string Script
class of this ai
Definition: ai_local.h:65
AiForceManager::getIndex
int getIndex(AiForce *force) const
Definition: ai_local.h:212
PlayerAi::FirstExplorationRequest
std::vector< AiExplorationRequest > FirstExplorationRequest
Build new depots if nessesary.
Definition: ai_local.h:311
AiAssignToForce
bool AiAssignToForce(CUnit &unit)
Assign a new unit to a force.
Definition: ai_force.cpp:713
PlayerAi::NeededMask
int NeededMask
Collect % of resources.
Definition: ai_local.h:306
AiForce::GoalPos
Vec2i GoalPos
Attack state.
Definition: ai_local.h:188
Vec2T
Definition: vec2i.h:36
AiHelper::Refinery
std::vector< std::vector< CUnitType * > > & Refinery()
Definition: ai.cpp:1092
AiForceAttackingState_Free
@ AiForceAttackingState_Free
Definition: ai_local.h:102
PlayerAi::Reserve
int Reserve[MaxCosts]
Forces controlled by AI.
Definition: ai_local.h:302
AiRemoveDeadUnitInForces
void AiRemoveDeadUnitInForces()
Cleanup units in force.
Definition: ai_force.cpp:703
AiForce::PlanAttack
int PlanAttack()
Definition: ai_plan.cpp:343
AiForceManager::Update
void Update()
Definition: ai_force.cpp:1138
AiAddUnitTypeRequest
void AiAddUnitTypeRequest(CUnitType &type, int count)
Current AI player.
Definition: ai_resource.cpp:1455
AI_MAX_FORCES
#define AI_MAX_FORCES
Definition: ai_local.h:194
CUpgrade
Definition: upgrade_structs.h:154
AiExplorationRequest
Definition: ai_local.h:265
AiForceAttackingState_Waiting
@ AiForceAttackingState_Waiting
Definition: ai_local.h:103
AiForce::State
AiForceAttackingState State
Original force number.
Definition: ai_local.h:187
PlayerAi::UnitTypeBuilt
std::vector< AiBuildQueue > UnitTypeBuilt
Upgrades requested and priority list.
Definition: ai_local.h:317
AiForceManager::Size
size_t Size() const
Definition: ai_local.h:207
AiHelper::UnitLimit
std::vector< std::vector< CUnitType * > > & UnitLimit()
Definition: ai.cpp:1080
AiForceManager
Definition: ai_local.h:202
CAiType
Definition: ai_local.h:57
AiBuildQueue::Made
unsigned int Made
requested number
Definition: ai_local.h:256
AiForce::Insert
void Insert(CUnit &unit)
Definition: ai_force.cpp:356
PlayerAi::BuildDepots
bool BuildDepots
Flag script debuging on/off.
Definition: ai_local.h:309
CAiType::Name
std::string Name
Definition: ai_local.h:62
CAiType::CAiType
CAiType()
Definition: ai_local.h:60
CUnitCache::Remove
CUnit * Remove(const unsigned int index)
Definition: unit_cache.h:140
AiHelper::Build
std::vector< std::vector< CUnitType * > > & Build()
Definition: ai.cpp:1050
AiForceManager::Assign
bool Assign(CUnit &unit, int force=-1)
Definition: ai_force.cpp:622
AiGetBuildRequestsCount
int AiGetBuildRequestsCount(const PlayerAi &pai, int(&counter)[UnitTypeMax])
Definition: ai_resource.cpp:343
AiCheckMagic
void AiCheckMagic()
Check for magic.
Definition: ai_magic.cpp:51
CUnitCache::size
size_t size() const
Definition: unit_cache.h:59
PlayerAi::ScriptDebug
bool ScriptDebug
Flag need food.
Definition: ai_local.h:308
AiForceManager::operator[]
const AiForce & operator[](unsigned int index) const
Definition: ai_local.h:209
PlayerAi::Script
std::string Script
AI type of this player AI.
Definition: ai_local.h:296
CAiType::Race
std::string Race
Name of this ai.
Definition: ai_local.h:63
AiForceAttackingState_AttackingWithTransporter
@ AiForceAttackingState_AttackingWithTransporter
Definition: ai_local.h:106
AiForce::Remove
void Remove(CUnit &unit)
Definition: ai_local.h:129
AiFindUnitTypeEquiv
int AiFindUnitTypeEquiv(const CUnitType &type, int *result)
Finds all equivalents units to a given one.
Definition: ai_force.cpp:246
AiForceManager
void AiForceManager()
Periodic called force manager handler.
Definition: ai_local.h:119
AiBuildQueue::AiBuildQueue
AiBuildQueue()
Definition: ai_local.h:249
AiRequestType::Count
unsigned int Count
Definition: ai_local.h:76
AiHelper::Depots
std::vector< std::vector< CUnitType * > > & Depots()
Definition: ai.cpp:1098
AiForceManager::operator[]
AiForce & operator[](unsigned int index)
Definition: ai_local.h:210
PlayerAi::Force
AiForceManager Force
Cycles to sleep.
Definition: ai_local.h:299
unit_cache.h
AiForce::Units
CUnitCache Units
Count and types of unit-type.
Definition: ai_local.h:183
AiResetUnitTypeEquiv
void AiResetUnitTypeEquiv()
Remove any equivalence between unittypes.
Definition: ai_force.cpp:206
PlayerAi::AiType
CAiType * AiType
Engine player structure.
Definition: ai_local.h:294
AiForce::Attack
void Attack(const Vec2i &pos)
Definition: ai_force.cpp:440
PlayerAi::NeedSupply
bool NeedSupply
Mask for needed resources.
Definition: ai_local.h:307
AiRequestType::AiRequestType
AiRequestType()
Definition: ai_local.h:74
AiForceManager::CheckUnits
void CheckUnits(int *counter)
Definition: ai_force.cpp:652
AiForce::Reset
void Reset(bool types=false)
Definition: ai_local.h:139
AiEnemyUnitsInDistance
bool AiEnemyUnitsInDistance(const CPlayer &player, const CUnitType *type, const Vec2i &pos, unsigned range)
Check if there are enemy units in a given range (optionally of type)
Definition: ai_resource.cpp:213
AiForceManager::getScriptForce
unsigned int getScriptForce(unsigned int index)
Definition: ai_local.h:222
AiUnitType::AiUnitType
AiUnitType()
Definition: ai_local.h:86
AiForce::HomePos
Vec2i HomePos
Attack point tile map position.
Definition: ai_local.h:189
PlayerAi::ResearchRequests
std::vector< CUpgrade * > ResearchRequests
Upgrade to unit-type requested and priority list.
Definition: ai_local.h:316
AiForce::WaitOnRallyPoint
int WaitOnRallyPoint
Return after attack tile map position.
Definition: ai_local.h:190
AiExplorationRequest::AiExplorationRequest
AiExplorationRequest(const Vec2i &pos, int mask)
Definition: ai_local.h:268
AiForceManager::AiForceManager
AiForceManager()
Definition: ai_force.cpp:562
AiFindBuildingPlace
bool AiFindBuildingPlace(const CUnit &worker, const CUnitType &type, const Vec2i &nearPos, Vec2i *resultPos)
Find nice building place.
Definition: ai_building.cpp:433
PlayerAi::Collect
int Collect[MaxCosts]
Needed resources.
Definition: ai_local.h:305
AiForce::IsAttacking
bool IsAttacking() const
Definition: ai_local.h:158
AiHelper::Upgrade
std::vector< std::vector< CUnitType * > > & Upgrade()
Definition: ai.cpp:1056
Vec2T::x
T x
Definition: vec2i.h:42
AiExplore
void AiExplore(const Vec2i &pos, int exploreMask)
Ask the ai to explore around pos.
Definition: ai_resource.cpp:1471
AiForce::RemoveDeadUnit
void RemoveDeadUnit()
Definition: ai_force.cpp:372
AiForce::Completed
bool Completed
Definition: ai_local.h:177
AiBuildQueue
Definition: ai_local.h:246
AiForceAttackingState
AiForceAttackingState
Definition: ai_local.h:101
AiForce::FormerForce
int FormerForce
Units in the force.
Definition: ai_local.h:186
upgrade_structs.h
AiAssignFreeUnitsToForce
void AiAssignFreeUnitsToForce(int force=-1)
Assign a free units to a force.
Definition: ai_force.cpp:721
UnitTypeMax
constexpr unsigned short UnitTypeMax
How many players are supported.
Definition: settings.h:63
AiFindWall
int AiFindWall(AiForce *force)
Find a wall to attack.
Definition: ai_plan.cpp:184
AiRequestType
Definition: ai_local.h:71
AiForce::Role
AiForceRole Role
Flag saying force is attacking.
Definition: ai_local.h:180
AiHelper::SingleResearch
std::vector< std::vector< CUnitType * > > & SingleResearch()
Definition: ai.cpp:1068
PlayerAi::SleepCycles
unsigned long SleepCycles
Script executed.
Definition: ai_local.h:297
AiHelper::Research
std::vector< std::vector< CUnitType * > > & Research()
Definition: ai.cpp:1062
AiHelper
Definition: ai_local.h:328
AiUnitType::Type
CUnitType * Type
number of this unit-type wanted
Definition: ai_local.h:89
AiAddUpgradeToRequest
void AiAddUpgradeToRequest(CUnitType &type)
Add upgrade-to request to resource manager.
Definition: ai_resource.cpp:836
AiHelper::Repair
std::vector< std::vector< CUnitType * > > & Repair()
Definition: ai.cpp:1074
AiForce::ReturnToHome
void ReturnToHome()
Definition: ai_force.cpp:545
AiHelpers
AiHelper AiHelpers
List of all AI types.
Definition: ai.cpp:165
CUnit
The big unit structure.
Definition: unit.h:135
AiBuildQueue::Want
unsigned int Want
Definition: ai_local.h:255
AiForceAttackingState_Attacking
@ AiForceAttackingState_Attacking
Definition: ai_local.h:107
AiExplorationRequest::Mask
int Mask
pos on map
Definition: ai_local.h:272
AiAttackWithForce
void AiAttackWithForce(unsigned int force)
Attack with force.
Definition: ai_force.cpp:764
CAiType::Class
std::string Class
for this race
Definition: ai_local.h:64
AiForceAttackingState_GoingToRallyPoint
@ AiForceAttackingState_GoingToRallyPoint
Definition: ai_local.h:105
PlayerAi::PlayerAi
PlayerAi()
Definition: ai_local.h:281
AiForce::UnitTypes
std::vector< AiUnitType > UnitTypes
Role of the force.
Definition: ai_local.h:182
(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.