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

ai.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 1998-2005 by Lutz Sammer
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_H__
31 #define __AI_H__
32 
34 
35 /*----------------------------------------------------------------------------
36 -- Declarations
37 ----------------------------------------------------------------------------*/
38 
39 class CPlayer;
40 class CFile;
41 class CUnit;
42 class CUnitType;
43 class CUpgrade;
44 
45 /*----------------------------------------------------------------------------
46 -- Variables
47 ----------------------------------------------------------------------------*/
48 
49 extern int AiSleepCycles;
50 
51 /*----------------------------------------------------------------------------
52 -- Functions
53 ----------------------------------------------------------------------------*/
54 
55 extern void AiEachCycle(CPlayer &player);
56 extern void AiEachSecond(CPlayer &player);
57 
58 extern void InitAiModule();
59 extern void AiInit(CPlayer &player);
60 extern void CleanAi();
61 extern void FreeAi();
62 extern void SaveAi(CFile &file);
63 
64 extern void AiCclRegister();
65 
67 extern void AiAttackWithForceAt(unsigned int force, int x, int y);
69 extern void AiAttackWithForce(unsigned int force);
70 
71 /*--------------------------------------------------------
72 -- Call Backs/Triggers
73 --------------------------------------------------------*/
74 
76 extern void AiHelpMe(const CUnit *attacker, CUnit &defender);
78 extern void AiUnitKilled(CUnit &unit);
80 extern void AiNeedMoreSupply(const CPlayer &player);
82 extern void AiWorkComplete(CUnit *unit, CUnit &what);
84 extern void AiCanNotBuild(const CUnit &unit, const CUnitType &what);
86 extern void AiCanNotReach(CUnit &unit, const CUnitType &what);
88 extern void AiCanNotMove(CUnit &unit);
90 extern void AiTrainingComplete(CUnit &unit, CUnit &what);
92 extern void AiUpgradeToComplete(CUnit &unit, const CUnitType &what);
94 extern void AiResearchComplete(CUnit &unit, const CUpgrade *what);
95 
97 
98 #endif // !__AI_H__
CPlayer
Diplomacy states for CommandDiplomacy.
Definition: player.h:83
AiEachSecond
void AiEachSecond(CPlayer &player)
Called each game cycle.
Definition: ai.cpp:1014
AiWorkComplete
void AiWorkComplete(CUnit *unit, CUnit &what)
Called if AI unit has completed work.
Definition: ai.cpp:772
AiCanNotBuild
void AiCanNotBuild(const CUnit &unit, const CUnitType &what)
Called if AI unit can't build.
Definition: ai.cpp:793
AiHelpMe
void AiHelpMe(const CUnit *attacker, CUnit &defender)
Called if AI unit is attacked.
Definition: ai.cpp:645
AiNeedMoreSupply
void AiNeedMoreSupply(const CPlayer &player)
Called if AI needs more farms.
Definition: ai.cpp:940
AiUpgradeToComplete
void AiUpgradeToComplete(CUnit &unit, const CUnitType &what)
Called if AI unit has completed upgrade to.
Definition: ai.cpp:973
CUnitType
Definition: unittype.h:508
AiTrainingComplete
void AiTrainingComplete(CUnit &unit, CUnit &what)
Called if AI unit has completed training.
Definition: ai.cpp:952
AiAttackWithForceAt
void AiAttackWithForceAt(unsigned int force, int x, int y)
Register ccl features.
Definition: ai_force.cpp:742
InitAiModule
void InitAiModule()
Called each second.
Definition: ai.cpp:486
CUpgrade
Definition: upgrade_structs.h:154
AiEachCycle
void AiEachCycle(CPlayer &player)
Ai sleeps # cycles.
Definition: ai.cpp:1004
AiCanNotMove
void AiCanNotMove(CUnit &unit)
Called if an AI unit can't move.
Definition: ai.cpp:922
SaveAi
void SaveAi(CFile &file)
Free the AI resources.
Definition: ai.cpp:410
AiInit
void AiInit(CPlayer &player)
Init AI global structures.
Definition: ai.cpp:428
CleanAi
void CleanAi()
Init AI for this player.
Definition: ai.cpp:495
AiResearchComplete
void AiResearchComplete(CUnit &unit, const CUpgrade *what)
Called if AI unit has completed research.
Definition: ai.cpp:988
AiCclRegister
void AiCclRegister()
Save the AI state.
Definition: script_ai.cpp:2001
FreeAi
void FreeAi()
Cleanup the AI module.
Definition: ai.cpp:507
AiAttackWithForce
void AiAttackWithForce(unsigned int force)
Attack with force.
Definition: ai_force.cpp:764
AiSleepCycles
int AiSleepCycles
Definition: ai.cpp:162
AiCanNotReach
void AiCanNotReach(CUnit &unit, const CUnitType &what)
Called if AI unit can't reach building place.
Definition: ai.cpp:809
AiUnitKilled
void AiUnitKilled(CUnit &unit)
Called if AI unit is killed.
Definition: ai.cpp:742
CFile
Definition: iolib.h:102
CUnit
The big unit structure.
Definition: unit.h:135
(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.