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

Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Friends | List of all members
CPlayer Class Reference

Diplomacy states for CommandDiplomacy. More...

#include <player.h>

Public Member Functions

void SetStartView (const Vec2i &pos)
 map tile start position More...
 
std::vector< CUnit * >::iterator UnitBegin ()
 
std::vector< CUnit * >::iterator UnitEnd ()
 
const std::vector< CUnit * > & GetUnits () const
 
std::vector< CUnit * >::iterator FreeWorkersBegin ()
 
std::vector< CUnit * >::iterator FreeWorkersEnd ()
 
void void bool IsEnemy (const int index) const
 
bool IsAllied (const int index) const
 
const std::set< uint8_t > & GetSharedVision () const
 
const std::set< uint8_t > & GetGaveVisionTo () const
 
bool HasSharedVisionWith (const CPlayer &player) const
 
bool IsRevealed () const
 
script_player.cpp - The player ccl functions.
void Load (lua_State *l)
 

Static Public Member Functions

static const bool IsRevelationEnabled ()
 type of revelation (when player lost their last main facility) More...
 
static const std::vector< const CPlayer * > & GetRevealedPlayers ()
 Get revealed players list. More...
 

Public Attributes

int Index
 
std::string Name
 player as number More...
 
PlayerTypes Type
 name of non computer More...
 
int Race
 type of player (human,computer,...) More...
 
std::string AiName
 race of player (orc,human,...) More...
 
int Team
 AI for computer. More...
 
Vec2i StartPos
 team of player More...
 
int Resources [MaxCosts]
 
int MaxResources [MaxCosts]
 resources in overall store More...
 
int StoredResources [MaxCosts]
 max resources can be stored More...
 
int LastResources [MaxCosts]
 resources in store buildings (can't exceed MaxResources) More...
 
int Incomes [MaxCosts]
 last values for revenue More...
 
int Revenue [MaxCosts]
 income of the resources More...
 
int SpeedResourcesHarvest [MaxCosts]
 income rate of the resources More...
 
int SpeedResourcesReturn [MaxCosts]
 speed factor for harvesting resources More...
 
int SpeedBuild
 speed factor for returning resources More...
 
int SpeedTrain
 speed factor for building More...
 
int SpeedUpgrade
 speed factor for training More...
 
int SpeedResearch
 speed factor for upgrading More...
 
int UnitTypesCount [UnitTypeMax]
 speed factor for researching More...
 
int UnitTypesAiActiveCount [UnitTypeMax]
 total units of unit-type More...
 
bool AiEnabled
 total units of unit-type that have their AI set to active More...
 
PlayerAiAi
 handle AI on local computer More...
 
int NumBuildings
 Ai structure pointer. More...
 
int Supply
 
int Demand
 supply available/produced More...
 
int UnitLimit
 demand of player More...
 
int BuildingLimit
 
int TotalUnitLimit
 
int Score
 
int TotalUnits
 Points for killing ... More...
 
int TotalBuildings
 
int TotalResources [MaxCosts]
 
int TotalRazings
 
int TotalKills
 
int LostMainFacilityTimer { 0 }
 How many unit killed. More...
 
IntColor Color
 (to make the player's units be revealed) More...
 
CAllow Allow
 color of units on minimap More...
 
CUpgradeTimers UpgradeTimers
 Allowed for player. More...
 

Static Public Attributes

static RevealTypes RevelationFor { RevealTypes::cNoRevelation }
 

Friends

void CleanPlayers ()
 whether the player has been revealed (i.e. after losing the last Town Hall) More...
 

player.cpp - The players.

static void SetRevelationType (const RevealTypes type)
 Change revelation type. More...
 
void SetName (const std::string &name)
 Timer for the upgrades. More...
 
void Clear ()
 Clear turn related player data. More...
 
std::vector< CUnit * >::const_iterator UnitBegin () const
 
std::vector< CUnit * >::const_iterator UnitEnd () const
 
CUnitGetUnit (int index) const
 
int GetUnitCount () const
 
void AddUnit (CUnit &unit)
 
void RemoveUnit (CUnit &unit)
 
std::vector< CUnit * >::const_iterator FreeWorkersBegin () const
 
std::vector< CUnit * >::const_iterator FreeWorkersEnd () const
 
CUnitGetFreeWorker (int index) const
 
int GetFreeWorkersCount () const
 
void UpdateFreeWorkers ()
 
void ClearUnitColors ()
 
void SetUnitColors (std::vector< CColor > &colors)
 
int GetResource (const int resource, const int type)
 Get a resource of the player. More...
 
void ChangeResource (const int resource, const int value, const bool store=false)
 Adds/subtracts some resources to/from the player store. More...
 
void SetResource (const int resource, const int value, const int type=STORE_OVERALL)
 Set a resource of the player. More...
 
bool CheckResource (const int resource, const int value)
 Check, if there enough resources for action. More...
 
int GetUnitTotalCount (const CUnitType &type) const
 Returns count of specified unittype. More...
 
int CheckLimits (const CUnitType &type) const
 Check if the unit-type didn't break any unit limits and supply/demand. More...
 
int CheckCosts (const int *costs, bool notify=true) const
 Check if enough resources are available for costs. More...
 
int CheckUnitType (const CUnitType &type) const
 Check if enough resources are available for a new unit-type. More...
 
void AddCosts (const int *costs)
 Add costs to the resources. More...
 
void AddUnitType (const CUnitType &type)
 Add costs for an unit-type to the resources. More...
 
void AddCostsFactor (const int *costs, int factor)
 Add a factor of costs to the resources. More...
 
void SubCosts (const int *costs)
 Remove costs from the resources. More...
 
void SubUnitType (const CUnitType &type)
 Remove costs for an unit-type from the resources. More...
 
void SubCostsFactor (const int *costs, int factor)
 Remove a factor of costs from the resources. More...
 
int HaveUnitTypeByType (const CUnitType &type) const
 Does the player have units of that type. More...
 
int HaveUnitTypeByIdent (const std::string &ident) const
 Does the player have units of that type. More...
 
void Notify (int type, const Vec2i &pos, const char *fmt,...) const PRINTF_VAARG_ATTRIBUTE(4
 Notify player about a problem. More...
 
void void Notify (const char *fmt,...) const PRINTF_VAARG_ATTRIBUTE(2
 Notify player about a problem. More...
 
bool IsEnemy (const CPlayer &player) const
 
bool IsEnemy (const CUnit &unit) const
 
bool IsAllied (const CPlayer &player) const
 
bool IsAllied (const CUnit &unit) const
 
bool IsVisionSharing () const
 
bool IsTeamed (const CPlayer &player) const
 
bool IsTeamed (const CUnit &unit) const
 
void SetDiplomacyNeutralWith (const CPlayer &player)
 
void SetDiplomacyAlliedWith (const CPlayer &player)
 
void SetDiplomacyEnemyWith (const CPlayer &player)
 
void SetDiplomacyCrazyWith (const CPlayer &player)
 
void ShareVisionWith (CPlayer &player)
 
void EnableSharedVisionFrom (const CPlayer &player)
 
void UnshareVisionWith (CPlayer &player)
 
void DisableSharedVisionFrom (const CPlayer &player)
 
void Init (PlayerTypes type)
 
void Save (CFile &file) const
 
void SetRevealed (const bool revealed)
 

Detailed Description

Diplomacy states for CommandDiplomacy.

Player structure

#include "player.h"

This structure contains all information about a player in game.

The player structure members:

CPlayer::Player

This is the unique slot number. It is not possible that two players have the same slot number at the same time. The slot numbers are reused in the future. This means if a player is defeated, a new player can join using this slot. Currently PlayerMax (16) players are supported. This member is used to access bit fields. Slot PlayerNumNeutral (15) is reserved for the neutral units like gold-mines or critters.

Note
Should call this member Slot?

CPlayer::Name

Name of the player used for displays and network game. It is restricted to 15 characters plus final zero.

CPlayer::Type

Type of the player. This field is setup from the level (map). We support currently PlayerNeutral, PlayerNobody, PlayerComputer, PlayerPerson, PlayerRescuePassive and PlayerRescueActive.

See also
PlayerTypes.

CPlayer::RaceName

Name of the race to which the player belongs, used to select the user interface and the AI. We have 'orc', 'human', 'alliance' or 'mythical'. Should only be used during configuration and not during runtime.

CPlayer::Race

Race number of the player. This field is setup from the level map. This number is mapped with PlayerRaces to the symbolic name CPlayer::RaceName.

CPlayer::AiName

AI name for computer. This field is setup from the map. Used to select the AI for the computer player.

CPlayer::Team

Team of player. Selected during network game setup. All players of the same team are allied and enemy to all other teams.

Note
It is planned to show the team on the map.

CPlayer::Enemy

A bit field which contains the enemies of this player. If CPlayer::Enemy & (1<<CPlayer::Player) != 0 its an enemy. Setup during startup using the CPlayer::Team, can later be changed with diplomacy. CPlayer::Enemy and CPlayer::Allied are combined, if none bit is set, the player is neutral.

Note
You can be allied to a player, which sees you as enemy.

CPlayer::Allied

A bit field which contains the allies of this player. If CPlayer::Allied & (1<<CPlayer::Player) != 0 its an allied. Setup during startup using the Player:Team, can later be changed with diplomacy. CPlayer::Enemy and CPlayer::Allied are combined, if none bit is set, the player is neutral.

Note
You can be allied to a player, which sees you as enemy.

CPlayer::SharedVision

Contains shared vision for this player. Shared vision only works when it's activated both ways. Really.

CPlayer::StartX CPlayer::StartY

The tile map coordinates of the player start position. 0,0 is the upper left on the map. This members are setup from the map and only important for the game start. Ignored if game starts with level settings. Used to place the initial workers if you play with 1 or 3 workers.

CPlayer::Resources[MaxCosts]

How many resources the player owns. Needed for building units and structures.

See also
costs, TimeCost, GoldCost, WoodCost, OilCost, MaxCosts.

CPlayer::MaxResources[MaxCosts]

How many resources the player can store at the moment.

CPlayer::Incomes[MaxCosts]

Income of the resources, when they are delivered at a store.

See also
costs, TimeCost, GoldCost, WoodCost, OilCost, MaxCosts.

CPlayer::LastResources[MaxCosts]

Keeps track of resources in time (used for calculating CPlayer::Revenue, see below)

CPlayer::Revenue[MaxCosts]

Production of resources per minute (or estimates) Used just as information (statistics) for the player...

CPlayer::UnitTypesCount[UnitTypeMax]

Total count for each different unit type. Used by the AI and for dependencies checks. The addition of all counts should be CPlayer::TotalNumUnits.

Note
Should not use the maximum number of unit-types here, only the real number of unit-types used.

CPlayer::AiEnabled

If the player is controlled by the computer and this flag is true, than the player is handled by the AI on this local computer.

Note
Currently the AI is calculated parallel on all computers in a network play. It is planned to change this.

CPlayer::Ai

AI structure pointer. Please look at PlayerAi for more information.

CPlayer::Units

A table of all (CPlayer::TotalNumUnits) units of the player.

CPlayer::TotalNumUnits

Total number of units (incl. buildings) in the CPlayer::Units table.

CPlayer::Demand

Total unit demand, used to demand limit. A player can only build up to CPlayer::Food units and not more than CPlayer::FoodUnitLimit units.

Note
that CPlayer::NumFoodUnits > CPlayer::Food, when enough farms are destroyed.

CPlayer::NumBuildings

Total number buildings, units that don't need food.

CPlayer::Food

Number of food available/produced. Player can't train more CPlayer::NumFoodUnits than this.

Note
that all limits are always checked.

CPlayer::FoodUnitLimit

Number of food units allowed. Player can't train more CPlayer::NumFoodUnits than this.

Note
that all limits are always checked.

CPlayer::BuildingLimit

Number of buildings allowed. Player can't build more CPlayer::NumBuildings than this.

Note
that all limits are always checked.

CPlayer::TotalUnitLimit

Number of total units allowed. Player can't have more CPlayer::NumFoodUnits+CPlayer::NumBuildings=CPlayer::TotalNumUnits this.

Note
that all limits are always checked.

CPlayer::Score

Total number of points. You can get points for killing units, destroying buildings ...

CPlayer::TotalUnits

Total number of units made.

CPlayer::TotalBuildings

Total number of buildings made.

CPlayer::TotalResources[MaxCosts]

Total number of resources collected.

See also
costs, TimeCost, GoldCost, WoodCost, OilCost, MaxCosts.

CPlayer::TotalRazings

Total number of buildings destroyed.

CPlayer::TotalKills

Total number of kills.

CPlayer::Color

Color of units of this player on the minimap. Index number into the global palette.

CPlayer::UnitColors

Unit colors of this player. Contains the hardware dependent pixel values for the player colors (palette index #208-#211). Setup from the global palette.

Note
Index #208-#211 are various SHADES of the team color (#208 is brightest shade, #211 is darkest shade) .... these numbers are NOT red=#208, blue=#209, etc

CPlayer::Allow

Contains which unit-types and upgrades are allowed for the player. Possible values are:

Timer for the upgrades. One timer for all possible upgrades. Initial 0 counted up by the upgrade action, until it reaches the upgrade time.

See also
upgrade_timers
Note
it is planned to combine research for faster upgrades.

Member Function Documentation

◆ AddCosts()

void CPlayer::AddCosts ( const int *  costs)

Add costs to the resources.

Add costs to the resources

Parameters
costsHow many costs.

◆ AddCostsFactor()

void CPlayer::AddCostsFactor ( const int *  costs,
int  factor 
)

Add a factor of costs to the resources.

Add a factor of costs to the resources

Parameters
costsHow many costs.
factorFactor of the costs to apply.

◆ AddUnit()

void CPlayer::AddUnit ( CUnit unit)

◆ AddUnitType()

void CPlayer::AddUnitType ( const CUnitType type)

Add costs for an unit-type to the resources.

Add the costs of an unit type to resources

Parameters
typeType of unit.

◆ ChangeResource()

void CPlayer::ChangeResource ( const int  resource,
const int  value,
const bool  store = false 
)

Adds/subtracts some resources to/from the player store.

Adds/subtracts some resources to/from the player store

Parameters
resourceResource to add/subtract.
valueHow many of this resource (can be negative).
storeIf true, sets the building store resources, else the overall resources.

◆ CheckCosts()

int CPlayer::CheckCosts ( const int *  costs,
bool  notify = true 
) const

Check if enough resources are available for costs.

Check if enough resources for are available.

Parameters
costsHow many costs.
Returns
False if all enough, otherwise a bit mask.
Note
The return values of the PlayerCheck functions are inconsistent.

◆ CheckLimits()

int CPlayer::CheckLimits ( const CUnitType type) const

Check if the unit-type didn't break any unit limits and supply/demand.

Check if the unit-type didn't break any unit limits.

Parameters
typeType of unit.
Returns
True if enough, negative on problem.
Note
The return values of the PlayerCheck functions are inconsistent.

◆ CheckResource()

bool CPlayer::CheckResource ( const int  resource,
const int  value 
)

Check, if there enough resources for action.

Check, if there enough resources for action.

Parameters
resourceResource to change.
valueHow many of this resource.

◆ CheckUnitType()

int CPlayer::CheckUnitType ( const CUnitType type) const

Check if enough resources are available for a new unit-type.

Check if enough resources for new unit is available.

Parameters
typeType of unit.
Returns
False if all enough, otherwise a bit mask.

◆ Clear()

void CPlayer::Clear ( )

Clear turn related player data.

Clear all player data excepts members which don't change.

The fields that are not cleared are UnitLimit, BuildingLimit, TotalUnitLimit and Allow.

◆ ClearUnitColors()

void CPlayer::ClearUnitColors ( )

◆ DisableSharedVisionFrom()

void CPlayer::DisableSharedVisionFrom ( const CPlayer player)

◆ EnableSharedVisionFrom()

void CPlayer::EnableSharedVisionFrom ( const CPlayer player)

◆ FreeWorkersBegin() [1/2]

std::vector<CUnit *>::iterator CPlayer::FreeWorkersBegin ( )

◆ FreeWorkersBegin() [2/2]

std::vector< CUnit * >::iterator CPlayer::FreeWorkersBegin ( ) const

◆ FreeWorkersEnd() [1/2]

std::vector<CUnit *>::iterator CPlayer::FreeWorkersEnd ( )

◆ FreeWorkersEnd() [2/2]

std::vector< CUnit * >::iterator CPlayer::FreeWorkersEnd ( ) const

◆ GetFreeWorker()

CUnit * CPlayer::GetFreeWorker ( int  index) const

◆ GetFreeWorkersCount()

int CPlayer::GetFreeWorkersCount ( ) const

◆ GetGaveVisionTo()

const std::set<uint8_t>& CPlayer::GetGaveVisionTo ( ) const
inline

◆ GetResource()

int CPlayer::GetResource ( const int  resource,
const int  type 
)

Get a resource of the player.

Gets the player resource.

Parameters
resourceResource to get.
typeStoring type
Note
Storing types: 0 - overall store, 1 - store buildings, 2 - both

◆ GetRevealedPlayers()

static const std::vector<const CPlayer *>& CPlayer::GetRevealedPlayers ( )
inlinestatic

Get revealed players list.

◆ GetSharedVision()

const std::set<uint8_t>& CPlayer::GetSharedVision ( ) const
inline

◆ GetUnit()

CUnit & CPlayer::GetUnit ( int  index) const

◆ GetUnitCount()

int CPlayer::GetUnitCount ( ) const

◆ GetUnits()

const std::vector<CUnit *>& CPlayer::GetUnits ( ) const
inline

◆ GetUnitTotalCount()

int CPlayer::GetUnitTotalCount ( const CUnitType type) const

Returns count of specified unittype.

◆ HasSharedVisionWith()

bool CPlayer::HasSharedVisionWith ( const CPlayer player) const
inline

◆ HaveUnitTypeByIdent()

int CPlayer::HaveUnitTypeByIdent ( const std::string &  ident) const

Does the player have units of that type.

Have unit of type.

Parameters
identIdentifier of unit-type that should be lookuped.
Returns
How many exists, false otherwise.
Note
This function should not be used during run time.

◆ HaveUnitTypeByType()

int CPlayer::HaveUnitTypeByType ( const CUnitType type) const

Does the player have units of that type.

Have unit of type.

Parameters
typeType of unit.
Returns
How many exists, false otherwise.

◆ Init()

void CPlayer::Init ( PlayerTypes  type)

◆ IsAllied() [1/3]

bool CPlayer::IsAllied ( const CPlayer player) const

Check if the player is an ally

◆ IsAllied() [2/3]

bool CPlayer::IsAllied ( const CUnit unit) const

Check if the unit is an ally

◆ IsAllied() [3/3]

bool CPlayer::IsAllied ( const int  index) const
inline

Check if the player index is an enemy

◆ IsEnemy() [1/3]

bool CPlayer::IsEnemy ( const CPlayer player) const

Check if the player is an enemy

◆ IsEnemy() [2/3]

bool CPlayer::IsEnemy ( const CUnit unit) const

Check if the unit is an enemy

◆ IsEnemy() [3/3]

void void bool CPlayer::IsEnemy ( const int  index) const
inline

Check if the player index is an enemy

◆ IsRevealed()

bool CPlayer::IsRevealed ( ) const
inline

◆ IsRevelationEnabled()

static const bool CPlayer::IsRevelationEnabled ( )
inlinestatic

type of revelation (when player lost their last main facility)

Check if relevation enabled

◆ IsTeamed() [1/2]

bool CPlayer::IsTeamed ( const CPlayer player) const

Check if the player is teamed

◆ IsTeamed() [2/2]

bool CPlayer::IsTeamed ( const CUnit unit) const

Check if the unit is teamed

◆ IsVisionSharing()

bool CPlayer::IsVisionSharing ( ) const

◆ Load()

void CPlayer::Load ( lua_State *  l)

◆ Notify() [1/2]

void CPlayer::Notify ( const char *  fmt,
  ... 
) const

Notify player about a problem.

Notify player about a problem.

Parameters
typeProblem type
posMap tile position
fmtMessage format
...Message varargs
Todo:
FIXME: We must also notfiy allied players.

◆ Notify() [2/2]

void CPlayer::Notify ( int  type,
const Vec2i pos,
const char *  fmt,
  ... 
) const

Notify player about a problem.

Notify player about a problem.

Parameters
typeProblem type
posMap tile position
fmtMessage format
...Message varargs
Todo:
FIXME: We must also notfiy allied players.

◆ RemoveUnit()

void CPlayer::RemoveUnit ( CUnit unit)

◆ Save()

void CPlayer::Save ( CFile file) const

◆ SetDiplomacyAlliedWith()

void CPlayer::SetDiplomacyAlliedWith ( const CPlayer player)

◆ SetDiplomacyCrazyWith()

void CPlayer::SetDiplomacyCrazyWith ( const CPlayer player)

◆ SetDiplomacyEnemyWith()

void CPlayer::SetDiplomacyEnemyWith ( const CPlayer player)

◆ SetDiplomacyNeutralWith()

void CPlayer::SetDiplomacyNeutralWith ( const CPlayer player)

◆ SetName()

void CPlayer::SetName ( const std::string &  name)

Timer for the upgrades.

Change player name

Change player name.

Parameters
nameNew name.

◆ SetResource()

void CPlayer::SetResource ( const int  resource,
const int  value,
const int  type = STORE_OVERALL 
)

Set a resource of the player.

Change the player resource.

Parameters
resourceResource to change.
valueHow many of this resource.
typeResource types: 0 - overall store, 1 - store buildings, 2 - both

◆ SetRevealed()

void CPlayer::SetRevealed ( const bool  revealed)

Add/remove players to/from list of revealed players

Remove element from vector;

◆ SetRevelationType()

void CPlayer::SetRevelationType ( const RevealTypes  type)
static

Change revelation type.

Change revelation type

◆ SetStartView()

void CPlayer::SetStartView ( const Vec2i pos)
inline

map tile start position

◆ SetUnitColors()

void CPlayer::SetUnitColors ( std::vector< CColor > &  colors)

◆ ShareVisionWith()

void CPlayer::ShareVisionWith ( CPlayer player)

◆ SubCosts()

void CPlayer::SubCosts ( const int *  costs)

Remove costs from the resources.

Subtract costs from the resources

Parameters
costsHow many costs.

◆ SubCostsFactor()

void CPlayer::SubCostsFactor ( const int *  costs,
int  factor 
)

Remove a factor of costs from the resources.

Subtract a factor of costs from the resources

Parameters
costsHow many costs.
factorFactor of the costs to apply.

◆ SubUnitType()

void CPlayer::SubUnitType ( const CUnitType type)

Remove costs for an unit-type from the resources.

Subtract the costs of new unit from resources

Parameters
typeType of unit.

◆ UnitBegin() [1/2]

std::vector<CUnit *>::iterator CPlayer::UnitBegin ( )

◆ UnitBegin() [2/2]

std::vector< CUnit * >::iterator CPlayer::UnitBegin ( ) const

◆ UnitEnd() [1/2]

std::vector<CUnit *>::iterator CPlayer::UnitEnd ( )

◆ UnitEnd() [2/2]

std::vector< CUnit * >::iterator CPlayer::UnitEnd ( ) const

◆ UnshareVisionWith()

void CPlayer::UnshareVisionWith ( CPlayer player)

◆ UpdateFreeWorkers()

void CPlayer::UpdateFreeWorkers ( )

Friends And Related Function Documentation

◆ CleanPlayers

void CleanPlayers ( )
friend

whether the player has been revealed (i.e. after losing the last Town Hall)

Clean up players.

Member Data Documentation

◆ Ai

PlayerAi* CPlayer::Ai

handle AI on local computer

◆ AiEnabled

bool CPlayer::AiEnabled

total units of unit-type that have their AI set to active

◆ AiName

std::string CPlayer::AiName

race of player (orc,human,...)

◆ Allow

CAllow CPlayer::Allow

color of units on minimap

◆ BuildingLimit

int CPlayer::BuildingLimit

food units allowed

◆ Color

IntColor CPlayer::Color

(to make the player's units be revealed)

The timer for when the player lost the last town hall

◆ Demand

int CPlayer::Demand

supply available/produced

◆ Incomes

int CPlayer::Incomes[MaxCosts]

last values for revenue

◆ Index

int CPlayer::Index

◆ LastResources

int CPlayer::LastResources[MaxCosts]

resources in store buildings (can't exceed MaxResources)

◆ LostMainFacilityTimer

int CPlayer::LostMainFacilityTimer { 0 }

How many unit killed.

◆ MaxResources

int CPlayer::MaxResources[MaxCosts]

resources in overall store

◆ Name

std::string CPlayer::Name

player as number

◆ NumBuildings

int CPlayer::NumBuildings

Ai structure pointer.

◆ Race

int CPlayer::Race

type of player (human,computer,...)

◆ Resources

int CPlayer::Resources[MaxCosts]

◆ RevelationFor

RevealTypes CPlayer::RevelationFor { RevealTypes::cNoRevelation }
inlinestatic

◆ Revenue

int CPlayer::Revenue[MaxCosts]

income of the resources

◆ Score

int CPlayer::Score

total unit number allowed

◆ SpeedBuild

int CPlayer::SpeedBuild

speed factor for returning resources

◆ SpeedResearch

int CPlayer::SpeedResearch

speed factor for upgrading

◆ SpeedResourcesHarvest

int CPlayer::SpeedResourcesHarvest[MaxCosts]

income rate of the resources

◆ SpeedResourcesReturn

int CPlayer::SpeedResourcesReturn[MaxCosts]

speed factor for harvesting resources

◆ SpeedTrain

int CPlayer::SpeedTrain

speed factor for building

◆ SpeedUpgrade

int CPlayer::SpeedUpgrade

speed factor for training

◆ StartPos

Vec2i CPlayer::StartPos

team of player

◆ StoredResources

int CPlayer::StoredResources[MaxCosts]

max resources can be stored

◆ Supply

int CPlayer::Supply

buildings

◆ Team

int CPlayer::Team

AI for computer.

◆ TotalBuildings

int CPlayer::TotalBuildings

◆ TotalKills

int CPlayer::TotalKills

◆ TotalRazings

int CPlayer::TotalRazings

◆ TotalResources

int CPlayer::TotalResources[MaxCosts]

◆ TotalUnitLimit

int CPlayer::TotalUnitLimit

buildings allowed

◆ TotalUnits

int CPlayer::TotalUnits

Points for killing ...

◆ Type

PlayerTypes CPlayer::Type

name of non computer

◆ UnitLimit

int CPlayer::UnitLimit

demand of player

◆ UnitTypesAiActiveCount

int CPlayer::UnitTypesAiActiveCount[UnitTypeMax]

total units of unit-type

◆ UnitTypesCount

int CPlayer::UnitTypesCount[UnitTypeMax]

speed factor for researching

◆ UpgradeTimers

CUpgradeTimers CPlayer::UpgradeTimers

Allowed for player.


The documentation for this class was generated from the following files:
(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.