Debian Codegraph @

engine/include/upgrade_structs.h

raw
1 // ____ _ __
2 // / __ )____ _____ | | / /___ ___________
3 // / __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/
4 // / /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ )
5 // /_____/\____/____/ |__/|__/\__,_/_/ /____/
6 //
7 // A futuristic real-time strategy game.
8 // This file is part of Bos Wars.
9 //
10 /**@name upgrade_structs.h - The upgrade/allow headerfile. */
11 //
12 // (c) Copyright 1999-2007 by Vladi Belperchinov-Shabanski and
13 // 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 #ifndef __UPGRADE_STRUCTS_H__
30 #define __UPGRADE_STRUCTS_H__
31
32 //@{
33
34 /*----------------------------------------------------------------------------
35 -- Declarations
36 ----------------------------------------------------------------------------*/
37
38 class CUnitType;
39 class CVariable;
40 class CIcon;
41
42 /**
43 ** Indices into costs/resource/income array.
44 */
45 enum CostType {
46 EnergyCost, /// energy resource
47 MagmaCost, /// magma resource
48
49 MaxCosts /// how many different costs
50 };
51
52 /**
53 ** Default resources for a new player.
54 */
55 extern int DefaultResources[MaxCosts];
56
57 /**
58 ** Default resources for a new player with low resources.
59 */
60 extern int DefaultResourcesLow[MaxCosts];
61
62 /**
63 ** Default resources for a new player with mid resources.
64 */
65 extern int DefaultResourcesMedium[MaxCosts];
66
67 /**
68 ** Default resources for a new player with high resources.
69 */
70 extern int DefaultResourcesHigh[MaxCosts];
71
72 /**
73 ** Default names for the resources.
74 */
75 extern std::string DefaultResourceNames[MaxCosts];
76
77 /**
78 ** Default names for the resources used for display (localized).
79 */
80 extern std::string DefaultDisplayResourceNames[MaxCosts];
81
82 /**
83 ** These are the current stats of a unit. Upgraded or downgraded.
84 */
85 class CUnitStats {
86 public:
87 CUnitStats() : Variables(NULL) {}
88
89 CVariable *Variables; /// user defined variable.
90 };
91
92 /*----------------------------------------------------------------------------
93 -- upgrades and modifiers
94 ----------------------------------------------------------------------------*/
95
96 /**
97 ** Allow what a player can do. Every #CPlayer has an own allow struct.
98 **
99 ** This could allow/disallow units, actions or upgrades.
100 **
101 ** Values are:
102 ** @li `A' -- allowed,
103 ** @li `F' -- forbidden,
104 ** @li `R' -- acquired, perhaps other values
105 ** @li `Q' -- acquired but forbidden (does it make sense?:))
106 ** @li `E' -- enabled, allowed by level but currently forbidden
107 ** @li `X' -- fixed, acquired can't be disabled
108 */
109 class CAllow {
110 public:
111 CAllow() { this->Clear(); }
112
113 void Clear() {
114 memset(Units, 0, sizeof(Units));
115 }
116
117 int Units[UnitTypeMax]; /// maximum amount of units allowed
118 };
119
120 //@}
121
122 #endif // !__UPGRADE_STRUCTS_H__