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

depend.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-2007 by Vladi Belperchinov-Shabanski
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 __DEPEND_H__
31 #define __DEPEND_H__
32 
34 
35 /*----------------------------------------------------------------------------
36 -- Documentation
37 ----------------------------------------------------------------------------*/
38 
91 /*----------------------------------------------------------------------------
92 -- Declarations
93 ----------------------------------------------------------------------------*/
94 
95 class CPlayer;
96 class CUnitType;
97 class CUpgrade;
98 class ButtonAction;
99 
100 enum {
103 };
104 
107 {
108 public:
110  unsigned char Count;
111  char Type;
112  union {
114  const CUpgrade *Upgrade;
115  } Kind;
117 };
118 
119 /*----------------------------------------------------------------------------
120 -- Functions
121 ----------------------------------------------------------------------------*/
122 
124 extern void DependenciesCclRegister();
126 extern void InitDependencies();
128 extern void CleanDependencies();
129 
131 extern std::string PrintDependencies(const CPlayer &player, const ButtonAction &button);
133 extern bool CheckDependByIdent(const CPlayer &player, const std::string &target);
135 extern bool CheckDependByType(const CPlayer &player, const CUnitType &type);
137 
138 #endif // !__DEPEND_H__
CPlayer
Diplomacy states for CommandDiplomacy.
Definition: player.h:83
CheckDependByType
bool CheckDependByType(const CPlayer &player, const CUnitType &type)
Check a dependency by unit type.
Definition: depend.cpp:362
DependRuleUpgrade
@ DependRuleUpgrade
Kind is an unit-type.
Definition: depend.h:102
ButtonAction
Action of button.
Definition: interface.h:88
DependRule::Upgrade
const CUpgrade * Upgrade
unit-type pointer
Definition: depend.h:114
DependRule::Count
unsigned char Count
next hash chain, or rules
Definition: depend.h:110
CUnitType
Definition: unittype.h:508
DependRuleUnitType
@ DependRuleUnitType
Definition: depend.h:101
DependRule::Kind
union DependRule::@14 Kind
an unit-type or upgrade
DependRule
Dependency rule.
Definition: depend.h:106
CleanDependencies
void CleanDependencies()
Cleanup dependencies module.
Definition: depend.cpp:384
CUpgrade
Definition: upgrade_structs.h:154
DependRule::Rule
DependRule * Rule
required object
Definition: depend.h:116
PrintDependencies
std::string PrintDependencies(const CPlayer &player, const ButtonAction &button)
Print all unit dependencies into string.
Definition: depend.cpp:236
DependRule::Type
char Type
how many required
Definition: depend.h:111
DependenciesCclRegister
void DependenciesCclRegister()
Register CCL features for dependencies.
Definition: depend.cpp:505
InitDependencies
void InitDependencies()
Init the dependencies.
Definition: depend.cpp:377
DependRule::Next
DependRule * Next
Definition: depend.h:109
DependRule::UnitType
const CUnitType * UnitType
Definition: depend.h:113
CheckDependByIdent
bool CheckDependByIdent(const CPlayer &player, const std::string &target)
Check a dependency by identifier.
Definition: depend.cpp:326
(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.