____ _ __
/ __ )____ _____ | | / /___ ___________
/ __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/
/ /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ )
/_____/\____/____/ |__/|__/\__,_/_/ /____/
A futuristic real-time strategy game.
This file is part of Bos Wars.
(C) Copyright 2001-2007 by the Bos Wars and Stratagus Project.
Distributed under the "GNU General Public License"00001 // ____ _ __ 00002 // / __ )____ _____ | | / /___ ___________ 00003 // / __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/ 00004 // / /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ ) 00005 // /_____/\____/____/ |__/|__/\__,_/_/ /____/ 00006 // 00007 // A futuristic real-time strategy game. 00008 // This file is part of Bos Wars. 00009 // 00011 // 00012 // (c) Copyright 2002-2007 by Lutz Sammer and Jimmy Salmon 00013 // 00014 // This program is free software; you can redistribute it and/or modify 00015 // it under the terms of the GNU General Public License as published by 00016 // the Free Software Foundation; only version 2 of the License. 00017 // 00018 // This program is distributed in the hope that it will be useful, 00019 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00020 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00021 // GNU General Public License for more details. 00022 // 00023 // You should have received a copy of the GNU General Public License 00024 // along with this program; if not, write to the Free Software 00025 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 00026 // 02111-1307, USA. 00027 00028 #ifndef __TRIGGER_H__ 00029 #define __TRIGGER_H__ 00030 00032 00033 /*---------------------------------------------------------------------------- 00034 -- Declarations 00035 ----------------------------------------------------------------------------*/ 00036 00037 class CUnit; 00038 class CUnitType; 00039 struct lua_State; 00040 class CFile; 00041 00045 class CTimer { 00046 public: 00047 CTimer() : Init(false), Running(false), Increasing(false), Cycles(0), 00048 LastUpdate(0) {} 00049 00050 void Reset() { 00051 Init = false; 00052 Running = false; 00053 Increasing = false; 00054 Cycles = 0; 00055 LastUpdate = 0; 00056 } 00057 00058 bool Init; 00059 bool Running; 00060 bool Increasing; 00061 long Cycles; 00062 unsigned long LastUpdate; 00063 }; 00064 00065 #define ANY_UNIT ((const CUnitType *)0) 00066 #define ALL_UNITS ((const CUnitType *)-1) 00067 #define ALL_FOODUNITS ((const CUnitType *)-2) 00068 #define ALL_BUILDINGS ((const CUnitType *)-3) 00069 00070 00074 typedef struct { 00075 CUnit *Attacker; 00076 CUnit *Defender; 00077 CUnit *Active; 00078 } TriggerDataType; 00079 00080 /*---------------------------------------------------------------------------- 00081 -- Variables 00082 ----------------------------------------------------------------------------*/ 00083 00084 extern CTimer GameTimer; 00085 00087 extern TriggerDataType TriggerData; 00088 00089 00090 /*---------------------------------------------------------------------------- 00091 -- Functions 00092 ----------------------------------------------------------------------------*/ 00093 00094 extern int TriggerGetPlayer(lua_State *l); 00095 extern const CUnitType *TriggerGetUnitType(lua_State *l); 00096 extern void TriggersEachCycle(void); 00097 00098 extern void TriggerCclRegister(void); 00099 extern void SaveTriggers(CFile *file); 00100 extern void InitTriggers(void); 00101 extern void CleanTriggers(void); 00102 00104 00105 #endif // !__TRIGGER_H__
1.5.6