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

trigger.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 2002-2005 by Lutz Sammer and Jimmy Salmon
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 __TRIGGER_H__
31 #define __TRIGGER_H__
32 
34 
35 /*----------------------------------------------------------------------------
36 -- Declarations
37 ----------------------------------------------------------------------------*/
38 
39 class CUnit;
40 class CUnitType;
41 struct lua_State;
42 class CFile;
43 
47 class CTimer
48 {
49 public:
50  CTimer() : Init(false), Running(false), Increasing(false), Cycles(0),
51  LastUpdate(0) {}
52 
53  void Reset()
54  {
55  Init = false;
56  Running = false;
57  Increasing = false;
58  Cycles = 0;
59  LastUpdate = 0;
60  }
61 
62  bool Init;
63  bool Running;
64  bool Increasing;
65  long Cycles;
66  unsigned long LastUpdate;
67 };
68 
69 #define ANY_UNIT ((const CUnitType *)0)
70 #define ALL_FOODUNITS ((const CUnitType *)-1)
71 #define ALL_BUILDINGS ((const CUnitType *)-2)
72 
73 
82 };
83 
84 /*----------------------------------------------------------------------------
85 -- Variables
86 ----------------------------------------------------------------------------*/
87 
88 extern CTimer GameTimer;
89 
92 
93 /*----------------------------------------------------------------------------
94 -- Functions
95 ----------------------------------------------------------------------------*/
96 
97 extern int TriggerGetPlayer(lua_State *l);
98 extern const CUnitType *TriggerGetUnitType(lua_State *l);
99 extern void TriggersEachCycle();
100 
101 extern void TriggerCclRegister();
102 extern void SaveTriggers(CFile &file);
103 extern void InitTriggers();
104 extern void CleanTriggers();
105 
107 
108 #endif // !__TRIGGER_H__
CTimer::CTimer
CTimer()
Definition: trigger.h:50
TriggerDataType::Defender
CUnit * Defender
Unit which send the missile.
Definition: trigger.h:79
CTimer::Reset
void Reset()
Definition: trigger.h:53
CTimer::Cycles
long Cycles
increasing or decreasing
Definition: trigger.h:65
SaveTriggers
void SaveTriggers(CFile &file)
Register ccl features.
Definition: trigger.cpp:637
CTimer::Increasing
bool Increasing
timer is running
Definition: trigger.h:64
InitTriggers
void InitTriggers()
Save the trigger module.
Definition: trigger.cpp:679
TriggerDataType::Attacker
CUnit * Attacker
Definition: trigger.h:78
TriggerData
TriggerDataType TriggerData
the game timer
Definition: trigger.cpp:59
GameTimer
CTimer GameTimer
Definition: trigger.cpp:54
CUnitType
Definition: unittype.h:508
CTimer::Running
bool Running
timer is initialized
Definition: trigger.h:63
TriggerGetUnitType
const CUnitType * TriggerGetUnitType(lua_State *l)
get player number.
Definition: trigger.cpp:99
TriggerCclRegister
void TriggerCclRegister()
test triggers
Definition: trigger.cpp:622
TriggersEachCycle
void TriggersEachCycle()
get the unit-type
Definition: trigger.cpp:578
TriggerDataType::Active
CUnit * Active
Unit which is hit by missile.
Definition: trigger.h:80
CTimer
Definition: trigger.h:47
CTimer::Init
bool Init
Definition: trigger.h:62
TriggerDataType::Type
CUnitType * Type
Unit which is selected or else under cursor unit.
Definition: trigger.h:81
TriggerDataType
Definition: trigger.h:77
CleanTriggers
void CleanTriggers()
Setup triggers.
Definition: trigger.cpp:696
TriggerGetPlayer
int TriggerGetPlayer(lua_State *l)
Definition: trigger.cpp:73
CFile
Definition: iolib.h:102
CUnit
The big unit structure.
Definition: unit.h:135
CTimer::LastUpdate
unsigned long LastUpdate
current value in game cycles
Definition: trigger.h:66
(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.