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

player.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 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 __PLAYER_H__
31 #define __PLAYER_H__
32 
34 
35 /*----------------------------------------------------------------------------
36 -- Includes
37 ----------------------------------------------------------------------------*/
38 
39 #include <set>
40 #include <string>
41 #include <vector>
42 
43 #include "color.h"
44 #include "upgrade_structs.h"
45 
46 #include "vec2i.h"
47 
48 #include "settings.h"
49 
50 class CGraphic;
51 
52 /*----------------------------------------------------------------------------
53 -- Definitons
54 ----------------------------------------------------------------------------*/
55 
56 #define STORE_OVERALL 0
57 #define STORE_BUILDING 1
58 #define STORE_BOTH 2
59 
60 #define SPEEDUP_FACTOR 100
61 /*----------------------------------------------------------------------------
62 -- Declarations
63 ----------------------------------------------------------------------------*/
64 
65 class CUnit;
66 class CUnitType;
67 class PlayerAi;
68 class CFile;
69 struct lua_State;
70 
71 /*----------------------------------------------------------------------------
72 -- Player type
73 ----------------------------------------------------------------------------*/
74 
80 };
81 
83 class CPlayer
84 {
85 public:
86  static inline RevealTypes RevelationFor { RevealTypes::cNoRevelation };
87 
88 public:
90  static const bool IsRevelationEnabled()
91  {
92  // By default there is no revelation. Can be changed in lua-script
93  return CPlayer::RevelationFor != RevealTypes::cNoRevelation;
94  }
96  static void SetRevelationType(const RevealTypes type);
98  static const std::vector<const CPlayer *> &GetRevealedPlayers()
99  {
100  return CPlayer::RevealedPlayers;
101  }
102 
103 private:
105  static inline std::vector<const CPlayer *> RevealedPlayers;
106 
107 public:
108  int Index;
109  std::string Name;
110 
112  int Race;
113  std::string AiName;
114 
115  // friend enemy detection
116  int Team;
117 
119 
120  inline void SetStartView(const Vec2i &pos) { StartPos = pos; }
121 
128 
135 
136  // FIXME: shouldn't use the constant
139 
140  bool AiEnabled;
142 
144  int Supply;
145  int Demand;
146 
147  int UnitLimit;
150 
151  int Score;
157 
159 
162 
163  // Upgrades/Allows:
166 
168  void SetName(const std::string &name);
169 
171  void Clear();
172 
173  std::vector<CUnit *>::const_iterator UnitBegin() const;
174  std::vector<CUnit *>::iterator UnitBegin();
175  std::vector<CUnit *>::const_iterator UnitEnd() const;
176  std::vector<CUnit *>::iterator UnitEnd();
177 
178  const std::vector<CUnit *> &GetUnits() const {
179  return this->Units;
180  }
181  CUnit &GetUnit(int index) const;
182  int GetUnitCount() const;
183 
184  void AddUnit(CUnit &unit);
185  void RemoveUnit(CUnit &unit);
186 
187  std::vector<CUnit *>::const_iterator FreeWorkersBegin() const;
188  std::vector<CUnit *>::const_iterator FreeWorkersEnd() const;
189  std::vector<CUnit *>::iterator FreeWorkersBegin();
190  std::vector<CUnit *>::iterator FreeWorkersEnd();
191 
192  CUnit *GetFreeWorker(int index) const;
193  int GetFreeWorkersCount() const;
194  void UpdateFreeWorkers();
195 
196  void ClearUnitColors();
197  void SetUnitColors(std::vector<CColor> &colors);
198 
200  int GetResource(const int resource, const int type);
202  void ChangeResource(const int resource, const int value, const bool store = false);
204  void SetResource(const int resource, const int value, const int type = STORE_OVERALL);
206  bool CheckResource(const int resource, const int value);
207 
209  int GetUnitTotalCount(const CUnitType &type) const;
211  int CheckLimits(const CUnitType &type) const;
212 
214  int CheckCosts(const int *costs, bool notify = true) const;
216  int CheckUnitType(const CUnitType &type) const;
217 
219  void AddCosts(const int *costs);
221  void AddUnitType(const CUnitType &type);
223  void AddCostsFactor(const int *costs, int factor);
225  void SubCosts(const int *costs);
227  void SubUnitType(const CUnitType &type);
229  void SubCostsFactor(const int *costs, int factor);
230 
232  int HaveUnitTypeByType(const CUnitType &type) const;
234  int HaveUnitTypeByIdent(const std::string &ident) const;
235 
237  void Notify(int type, const Vec2i &pos, const char *fmt, ...) const PRINTF_VAARG_ATTRIBUTE(4, 5); // Don't forget to count this
239  void Notify(const char *fmt, ...) const PRINTF_VAARG_ATTRIBUTE(2, 3); // Don't forget to count this
240 
241 
245  bool IsEnemy(const int index) const
246  {
247  return (Index != index && (Enemy & (1 << index)) != 0);
248  }
249 
253  bool IsAllied(const int index) const
254  {
255  return (Index != index && (Allied & (1 << index)) != 0);
256  }
257 
258  bool IsEnemy(const CPlayer &player) const;
259  bool IsEnemy(const CUnit &unit) const;
260  bool IsAllied(const CPlayer &player) const;
261  bool IsAllied(const CUnit &unit) const;
262  bool IsVisionSharing() const;
263  const std::set<uint8_t> &GetSharedVision() const
264  {
265  return this->HasVisionFrom;
266  }
267  const std::set<uint8_t> &GetGaveVisionTo() const
268  {
269  return this->GaveVisionTo;
270  }
271  bool HasSharedVisionWith(const CPlayer &player) const
272  {
273  return (this->GaveVisionTo.find(player.Index) != this->GaveVisionTo.end());
274  }
275  bool IsTeamed(const CPlayer &player) const;
276  bool IsTeamed(const CUnit &unit) const;
277 
278  void SetDiplomacyNeutralWith(const CPlayer &player);
279  void SetDiplomacyAlliedWith(const CPlayer &player);
280  void SetDiplomacyEnemyWith(const CPlayer &player);
281  void SetDiplomacyCrazyWith(const CPlayer &player);
282 
283  void ShareVisionWith(CPlayer &player);
284  void EnableSharedVisionFrom(const CPlayer &player);
285  void UnshareVisionWith(CPlayer &player);
286  void DisableSharedVisionFrom(const CPlayer &player);
287 
288  void Init(PlayerTypes type);
289  void Save(CFile &file) const;
290  void Load(lua_State *l);
291 
292  bool IsRevealed() const
293  {
294  return this->isRevealed;
295  }
296  void SetRevealed(const bool revealed);
297 
298 private:
299  CUnitColors UnitColors;
300  std::vector<CUnit *> Units;
301  std::vector<CUnit *> FreeWorkers;
302  unsigned int Enemy;
303  unsigned int Allied;
304  std::set<uint8_t> HasVisionFrom;
305  std::set<uint8_t> GaveVisionTo;
306 
307  bool isRevealed { false };
308 
309  friend void CleanPlayers();
310 };
311 
317 {
318 public:
320  {
321  memset(Visible, 0, sizeof(Visible));
322  }
323 
324  void Clean();
325  int GetRaceIndexByName(const char *raceName) const;
326 
327 public:
329  std::string Name[MAX_RACES];
330  std::string Display[MAX_RACES];
331  unsigned int Count;
332 };
333 
341 };
342 
343 /*----------------------------------------------------------------------------
344 -- Variables
345 ----------------------------------------------------------------------------*/
346 
347 extern int NumPlayers;
348 extern CPlayer Players[PlayerMax];
349 extern CPlayer *ThisPlayer;
350 extern bool NoRescueCheck;
351 extern std::vector<std::vector<CColor>> PlayerColorsRGB;
352 extern std::vector<std::vector<SDL_Color>> PlayerColorsSDL;
353 extern std::vector<std::string> PlayerColorNames;
354 
355 extern PlayerRace PlayerRaces;
356 
360 extern int PlayerColorIndexStart;
361 extern int PlayerColorIndexCount;
362 
363 /*----------------------------------------------------------------------------
364 -- Functions
365 ----------------------------------------------------------------------------*/
366 
368 extern void InitPlayers();
370 extern void CleanPlayers();
372 extern void SavePlayers(CFile &file);
373 
375 extern void CreatePlayer(PlayerTypes type);
376 
377 
379 extern void PlayersInitAi();
381 extern void PlayersEachCycle();
383 extern void PlayersEachSecond(int player);
384 
386 extern void GraphicPlayerPixels(int colorIndex, const CGraphic &sprite);
387 
389 extern void DebugPlayers();
390 
391 void FreePlayerColors();
392 
394 extern void PlayerCclRegister();
395 
397 inline bool CanSelectMultipleUnits(const CPlayer &player) { return &player == ThisPlayer || ThisPlayer->IsTeamed(player); }
398 
400 
401 #endif // !__PLAYER_H__
CPlayer::TotalUnits
int TotalUnits
Points for killing ...
Definition: player.h:152
CPlayer::AddCostsFactor
void AddCostsFactor(const int *costs, int factor)
Add a factor of costs to the resources.
Definition: player.cpp:1150
CPlayer
Diplomacy states for CommandDiplomacy.
Definition: player.h:83
DiplomacyCrazy
@ DiplomacyCrazy
Attack opponent.
Definition: player.h:79
NoRescueCheck
bool NoRescueCheck
Player on local computer.
Definition: player.cpp:316
CPlayer::TotalKills
int TotalKills
Definition: player.h:156
PlayerRace::Clean
void Clean()
Definition: player.cpp:347
CAllow
Definition: upgrade_structs.h:227
CPlayer::CleanPlayers
friend void CleanPlayers()
whether the player has been revealed (i.e. after losing the last Town Hall)
Definition: player.cpp:384
CPlayer::RemoveUnit
void RemoveUnit(CUnit &unit)
Definition: player.cpp:840
PlayerCclRegister
void PlayerCclRegister()
register ccl features
Definition: script_player.cpp:1261
MaxCosts
@ MaxCosts
resource 6
Definition: upgrade_structs.h:70
CPlayer::GetRevealedPlayers
static const std::vector< const CPlayer * > & GetRevealedPlayers()
Get revealed players list.
Definition: player.h:98
CPlayer::SubUnitType
void SubUnitType(const CUnitType &type)
Remove costs for an unit-type from the resources.
Definition: player.cpp:1174
PlayersEachSecond
void PlayersEachSecond(int player)
Called each second for a given player handler (AI)
Definition: player.cpp:1260
PlayerAi
Definition: ai_local.h:278
DiplomacyAllied
@ DiplomacyAllied
Definition: player.h:76
CPlayer::SetUnitColors
void SetUnitColors(std::vector< CColor > &colors)
Definition: player.cpp:1534
settings.h
DiplomacyNeutral
@ DiplomacyNeutral
Ally with opponent.
Definition: player.h:77
PlayerColorIndexStart
int PlayerColorIndexStart
Player races.
Definition: player.cpp:329
CPlayer::SetRevelationType
static void SetRevelationType(const RevealTypes type)
Change revelation type.
Definition: player.cpp:339
CPlayer::Team
int Team
AI for computer.
Definition: player.h:116
CPlayer::Type
PlayerTypes Type
name of non computer
Definition: player.h:111
CPlayer::FreeWorkersEnd
std::vector< CUnit * >::const_iterator FreeWorkersEnd() const
Definition: player.cpp:865
IntColor
uint32_t IntColor
Definition: color.h:37
CPlayer::SetResource
void SetResource(const int resource, const int value, const int type=STORE_OVERALL)
Set a resource of the player.
Definition: player.cpp:995
CPlayer::AddUnit
void AddUnit(CUnit &unit)
Definition: player.cpp:824
CPlayer::CheckCosts
int CheckCosts(const int *costs, bool notify=true) const
Check if enough resources are available for costs.
Definition: player.cpp:1088
CPlayer::SetDiplomacyEnemyWith
void SetDiplomacyEnemyWith(const CPlayer &player)
Definition: player.cpp:1439
CPlayer::SetStartView
void SetStartView(const Vec2i &pos)
map tile start position
Definition: player.h:120
CPlayer::Color
IntColor Color
(to make the player's units be revealed)
Definition: player.h:161
CPlayer::AiName
std::string AiName
race of player (orc,human,...)
Definition: player.h:113
CPlayer::GetUnits
const std::vector< CUnit * > & GetUnits() const
Definition: player.h:178
vec2i.h
CPlayer::GetResource
int GetResource(const int resource, const int type)
Get a resource of the player.
Definition: player.cpp:950
CPlayer::Index
int Index
Definition: player.h:108
CreatePlayer
void CreatePlayer(PlayerTypes type)
Create a new player.
Definition: player.cpp:604
CPlayer::UpdateFreeWorkers
void UpdateFreeWorkers()
Definition: player.cpp:885
CPlayer::LostMainFacilityTimer
int LostMainFacilityTimer
How many unit killed.
Definition: player.h:158
Players
CPlayer Players[PlayerMax]
How many player slots used.
Definition: player.cpp:312
CPlayer::GetUnit
CUnit & GetUnit(int index) const
Definition: player.cpp:926
CPlayer::TotalBuildings
int TotalBuildings
Definition: player.h:153
PlayerRace::Display
std::string Display[MAX_RACES]
race names
Definition: player.h:330
RevealTypes
ENUM_CLASS RevealTypes
Definition: settings.h:166
NotifyYellow
@ NotifyYellow
Red alram.
Definition: player.h:339
CUnitType
Definition: unittype.h:508
CPlayer::SpeedResearch
int SpeedResearch
speed factor for upgrading
Definition: player.h:134
CPlayer::AddCosts
void AddCosts(const int *costs)
Add costs to the resources.
Definition: player.cpp:1127
ThisPlayer
CPlayer * ThisPlayer
All players.
Definition: player.cpp:313
CPlayer::FreeWorkersBegin
std::vector< CUnit * >::const_iterator FreeWorkersBegin() const
Definition: player.cpp:855
NumPlayers
int NumPlayers
Definition: player.cpp:311
CPlayer::UnitBegin
std::vector< CUnit * >::const_iterator UnitBegin() const
Definition: player.cpp:906
STORE_OVERALL
#define STORE_OVERALL
Definition: player.h:56
CPlayer::UnitLimit
int UnitLimit
demand of player
Definition: player.h:147
Vec2T< short int >
SavePlayers
void SavePlayers(CFile &file)
Save players.
Definition: player.cpp:411
CPlayer::AddUnitType
void AddUnitType(const CUnitType &type)
Add costs for an unit-type to the resources.
Definition: player.cpp:1139
CPlayer::Save
void Save(CFile &file) const
Definition: player.cpp:444
CPlayer::TotalResources
int TotalResources[MaxCosts]
Definition: player.h:154
CPlayer::Allow
CAllow Allow
color of units on minimap
Definition: player.h:164
NotifyRed
@ NotifyRed
Definition: player.h:338
CPlayer::SpeedBuild
int SpeedBuild
speed factor for returning resources
Definition: player.h:131
CPlayer::SetDiplomacyAlliedWith
void SetDiplomacyAlliedWith(const CPlayer &player)
Definition: player.cpp:1433
GraphicPlayerPixels
void GraphicPlayerPixels(int colorIndex, const CGraphic &sprite)
Change current color set to the player color of the sprite.
Definition: player.cpp:1286
CPlayer::NumBuildings
int NumBuildings
Ai structure pointer.
Definition: player.h:143
NotifyType
NotifyType
Definition: player.h:337
PlayerMax
constexpr unsigned char PlayerMax
Definition: settings.h:62
CleanPlayers
void CleanPlayers()
Clean up players.
Definition: player.cpp:384
CPlayer::GetFreeWorkersCount
int GetFreeWorkersCount() const
Definition: player.cpp:880
CPlayer::SetDiplomacyCrazyWith
void SetDiplomacyCrazyWith(const CPlayer &player)
Definition: player.cpp:1445
CPlayer::SubCosts
void SubCosts(const int *costs)
Remove costs from the resources.
Definition: player.cpp:1162
CPlayer::MaxResources
int MaxResources[MaxCosts]
resources in overall store
Definition: player.h:123
CPlayer::UnitTypesCount
int UnitTypesCount[UnitTypeMax]
speed factor for researching
Definition: player.h:137
CPlayer::IsRevealed
bool IsRevealed() const
Definition: player.h:292
CPlayer::Resources
int Resources[MaxCosts]
Definition: player.h:122
_diplomacy_
_diplomacy_
Definition: player.h:75
CPlayer::LastResources
int LastResources[MaxCosts]
resources in store buildings (can't exceed MaxResources)
Definition: player.h:125
PlayerColorNames
std::vector< std::string > PlayerColorNames
Player colors.
Definition: player.cpp:324
CPlayer::ShareVisionWith
void ShareVisionWith(CPlayer &player)
Definition: player.cpp:1451
CPlayer::StartPos
Vec2i StartPos
team of player
Definition: player.h:118
CPlayer::GetUnitTotalCount
int GetUnitTotalCount(const CUnitType &type) const
Returns count of specified unittype.
Definition: player.cpp:1028
CPlayer::ClearUnitColors
void ClearUnitColors()
Definition: player.cpp:1529
PlayerColorsRGB
std::vector< std::vector< CColor > > PlayerColorsRGB
Disable rescue check.
Definition: player.cpp:321
CPlayer::Init
void Init(PlayerTypes type)
Definition: player.cpp:615
CPlayer::UpgradeTimers
CUpgradeTimers UpgradeTimers
Allowed for player.
Definition: player.h:165
CPlayer::IsVisionSharing
bool IsVisionSharing() const
Definition: player.cpp:1507
CPlayer::HasSharedVisionWith
bool HasSharedVisionWith(const CPlayer &player) const
Definition: player.h:271
CPlayer::SpeedUpgrade
int SpeedUpgrade
speed factor for training
Definition: player.h:133
CPlayer::TotalRazings
int TotalRazings
Definition: player.h:155
CPlayer::StoredResources
int StoredResources[MaxCosts]
max resources can be stored
Definition: player.h:124
CPlayer::Notify
void Notify(int type, const Vec2i &pos, const char *fmt,...) const PRINTF_VAARG_ATTRIBUTE(4
Notify player about a problem.
Definition: player.cpp:1361
CPlayer::Score
int Score
Definition: player.h:151
PlayerRace::PlayerRace
PlayerRace()
Definition: player.h:319
PlayerColorsSDL
std::vector< std::vector< SDL_Color > > PlayerColorsSDL
Player colors.
Definition: player.cpp:322
CPlayer::Incomes
int Incomes[MaxCosts]
last values for revenue
Definition: player.h:126
CPlayer::Supply
int Supply
Definition: player.h:144
CPlayer::CheckLimits
int CheckLimits(const CUnitType &type) const
Check if the unit-type didn't break any unit limits and supply/demand.
Definition: player.cpp:1053
InitPlayers
void InitPlayers()
Init players.
Definition: player.cpp:371
CPlayer::SubCostsFactor
void SubCostsFactor(const int *costs, int factor)
Remove a factor of costs from the resources.
Definition: player.cpp:1185
CPlayer::CheckResource
bool CheckResource(const int resource, const int value)
Check, if there enough resources for action.
Definition: player.cpp:1018
CPlayer::GetUnitCount
int GetUnitCount() const
Definition: player.cpp:931
CPlayer::Race
int Race
type of player (human,computer,...)
Definition: player.h:112
DebugPlayers
void DebugPlayers()
Output debug information for players.
Definition: player.cpp:1315
CPlayer::HaveUnitTypeByType
int HaveUnitTypeByType(const CUnitType &type) const
Does the player have units of that type.
Definition: player.cpp:1199
CUnitColors
Definition: color.h:69
CPlayer::IsEnemy
void void bool IsEnemy(const int index) const
Definition: player.h:245
PlayerRace::Count
unsigned int Count
text to display in pulldown
Definition: player.h:331
CPlayer::IsTeamed
bool IsTeamed(const CPlayer &player) const
Definition: player.cpp:1516
CPlayer::DisableSharedVisionFrom
void DisableSharedVisionFrom(const CPlayer &player)
Definition: player.cpp:1468
CPlayer::BuildingLimit
int BuildingLimit
Definition: player.h:148
CPlayer::EnableSharedVisionFrom
void EnableSharedVisionFrom(const CPlayer &player)
Definition: player.cpp:1457
CPlayer::Demand
int Demand
supply available/produced
Definition: player.h:145
CPlayer::SetDiplomacyNeutralWith
void SetDiplomacyNeutralWith(const CPlayer &player)
Definition: player.cpp:1427
PlayerRace
Definition: player.h:316
CPlayer::IsRevelationEnabled
static const bool IsRevelationEnabled()
type of revelation (when player lost their last main facility)
Definition: player.h:90
CanSelectMultipleUnits
bool CanSelectMultipleUnits(const CPlayer &player)
Allowed to select multiple units, maybe not mine.
Definition: player.h:397
CPlayer::SpeedTrain
int SpeedTrain
speed factor for building
Definition: player.h:132
DiplomacyEnemy
@ DiplomacyEnemy
Don't attack be neutral.
Definition: player.h:78
CPlayer::SpeedResourcesReturn
int SpeedResourcesReturn[MaxCosts]
speed factor for harvesting resources
Definition: player.h:130
MAX_RACES
constexpr unsigned char MAX_RACES
How many upgrades supported.
Definition: settings.h:65
PlayersInitAi
void PlayersInitAi()
Initialize the computer opponent AI.
Definition: player.cpp:1221
NotifyGreen
@ NotifyGreen
Yellow alarm.
Definition: player.h:340
CPlayer::IsAllied
bool IsAllied(const int index) const
Definition: player.h:253
CPlayer::GetGaveVisionTo
const std::set< uint8_t > & GetGaveVisionTo() const
Definition: player.h:267
CPlayer::TotalUnitLimit
int TotalUnitLimit
Definition: player.h:149
CPlayer::SpeedResourcesHarvest
int SpeedResourcesHarvest[MaxCosts]
income rate of the resources
Definition: player.h:129
FreePlayerColors
void FreePlayerColors()
Definition: player.cpp:395
CPlayer::GetSharedVision
const std::set< uint8_t > & GetSharedVision() const
Definition: player.h:263
upgrade_structs.h
CPlayer::GetFreeWorker
CUnit * GetFreeWorker(int index) const
Definition: player.cpp:875
CPlayer::UnitTypesAiActiveCount
int UnitTypesAiActiveCount[UnitTypeMax]
total units of unit-type
Definition: player.h:138
CPlayer::UnitEnd
std::vector< CUnit * >::const_iterator UnitEnd() const
Definition: player.cpp:916
UnitTypeMax
constexpr unsigned short UnitTypeMax
How many players are supported.
Definition: settings.h:63
CPlayer::Ai
PlayerAi * Ai
handle AI on local computer
Definition: player.h:141
CUpgradeTimers
Definition: upgrade_structs.h:246
CPlayer::Load
void Load(lua_State *l)
Definition: script_player.cpp:93
CPlayer::UnshareVisionWith
void UnshareVisionWith(CPlayer &player)
Definition: player.cpp:1462
color.h
PlayerRace::Visible
bool Visible[MAX_RACES]
Definition: player.h:328
PlayerRace::GetRaceIndexByName
int GetRaceIndexByName(const char *raceName) const
Definition: player.cpp:357
CPlayer::SetName
void SetName(const std::string &name)
Timer for the upgrades.
Definition: player.cpp:759
CPlayer::Revenue
int Revenue[MaxCosts]
income of the resources
Definition: player.h:127
CPlayer::SetRevealed
void SetRevealed(const bool revealed)
Definition: player.cpp:427
CPlayer::RevelationFor
static RevealTypes RevelationFor
Definition: player.h:86
PlayerRace::Name
std::string Name[MAX_RACES]
race should be visible in pulldown
Definition: player.h:329
CPlayer::ChangeResource
void ChangeResource(const int resource, const int value, const bool store=false)
Adds/subtracts some resources to/from the player store.
Definition: player.cpp:972
PlayerTypes
ENUM_CLASS PlayerTypes
Special: Use map supplied.
Definition: settings.h:118
PRINTF_VAARG_ATTRIBUTE
#define PRINTF_VAARG_ATTRIBUTE(a, b)
Definition: stratagus.h:108
CFile
Definition: iolib.h:102
CUnit
The big unit structure.
Definition: unit.h:135
PlayerColorIndexCount
int PlayerColorIndexCount
Definition: player.cpp:330
CPlayer::AiEnabled
bool AiEnabled
total units of unit-type that have their AI set to active
Definition: player.h:140
CPlayer::CheckUnitType
int CheckUnitType(const CUnitType &type) const
Check if enough resources are available for a new unit-type.
Definition: player.cpp:1117
CPlayer::Clear
void Clear()
Clear turn related player data.
Definition: player.cpp:770
PlayersEachCycle
void PlayersEachCycle()
Called each game cycle for player handlers (AI)
Definition: player.cpp:1233
CPlayer::Name
std::string Name
player as number
Definition: player.h:109
CGraphic
Definition: video.h:91
CPlayer::HaveUnitTypeByIdent
int HaveUnitTypeByIdent(const std::string &ident) const
Does the player have units of that type.
Definition: player.cpp:1213
PlayerRaces
PlayerRace PlayerRaces
Player color names.
Definition: player.cpp:314
(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.