____ _ __
/ __ )____ _____ | | / /___ ___________
/ __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/
/ /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ )
/_____/\____/____/ |__/|__/\__,_/_/ /____/
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"
#include <player.h>
Public Member Functions | |
| void | SetStartView (int x, int y) |
| void | SetEnergyProductionRate (int v) |
| int | GetEnergyProductionRate () |
| void | SetMagmaProductionRate (int v) |
| int | GetMagmaProductionRate () |
| void | SetEnergyStored (int v) |
| int | GetEnergyStored () |
| void | SetMagmaStored (int v) |
| int | GetMagmaStored () |
| void | SetEnergyStorageCapacity (int v) |
| int | GetEnergyStorageCapacity () |
| void | SetMagmaStorageCapacity (int v) |
| int | GetMagmaStorageCapacity () |
| void | AddToUnitsConsumingResources (CUnit *unit, int costs[MaxCosts]) |
| void | RemoveFromUnitsConsumingResources (CUnit *unit) |
| void | UpdateUnitsConsumingResources (CUnit *unit, int costs[MaxCosts]) |
| void | RebuildUnitsConsumingResourcesList () |
| void | ClearResourceVariables () |
| void | SetTotalEnergy (int v) |
| int | GetTotalEnergy () |
| void | SetTotalMagma (int v) |
| int | GetTotalMagma () |
| void | SetName (const std::string &name) |
| Clear turn related player data. | |
| void | Clear () |
| Set a resource of the player. | |
| void | SetResource (int resource, int value) |
| Check if the unit-type didn't break any unit limits and supply/demand. | |
| int | CheckLimits (const CUnitType *type) const |
| Does the player have units of that type. | |
| int | HaveUnitTypeByType (const CUnitType *type) const |
| Does the player have units of that type. | |
| int | HaveUnitTypeByIdent (const std::string &ident) const |
| Notify player about a problem. | |
| void | Notify (int type, int x, int y, const char *fmt,...) const |
| bool | IsEnemy (const CPlayer *x) const |
| bool | IsEnemy (const CUnit *x) const |
| bool | IsAllied (const CPlayer *x) const |
| bool | IsAllied (const CUnit *x) const |
| bool | IsSharedVision (const CPlayer *x) const |
| bool | IsSharedVision (const CUnit *x) const |
| bool | IsBothSharedVision (const CPlayer *x) const |
| bool | IsBothSharedVision (const CUnit *x) const |
| bool | IsTeamed (const CPlayer *x) const |
| bool | IsTeamed (const CUnit *x) const |
Public Attributes | |
| int | Index |
| player as number | |
| std::string | Name |
| name of non computer | |
| int | Type |
| type of player (human,computer,...) | |
| std::string | AiName |
| AI for computer. | |
| int | Team |
| team of player | |
| unsigned | Enemy |
| enemy bit field for this player | |
| unsigned | Allied |
| allied bit field for this player | |
| unsigned | SharedVision |
| shared vision bit field | |
| int | StartX |
| map tile start X position | |
| int | StartY |
| map tile start Y position | |
| std::map< CUnit *, int * > | UnitsConsumingResourcesActual |
| std::map< CUnit *, int * > | UnitsConsumingResourcesRequested |
| int | ProductionRate [MaxCosts] |
| Rate that resources are produced. | |
| int | ActualUtilizationRate [MaxCosts] |
| Rate that resources are used. | |
| int | RequestedUtilizationRate [MaxCosts] |
| Rate that resources are used. | |
| int | StoredResources [MaxCosts] |
| Amount of resources in storage. | |
| int | StorageCapacity [MaxCosts] |
| Storage capacity of resources. | |
| int | UnitTypesCount [UnitTypeMax] |
| total units of unit-type | |
| int | AiEnabled |
| handle AI on local computer | |
| PlayerAi * | Ai |
| Ai structure pointer. | |
| CUnit * | Units [UnitMax] |
| units of this player | |
| int | TotalNumUnits |
| total # units for units' list | |
| int | NumBuildings |
| # buildings | |
| int | UnitLimit |
| # food units allowed | |
| int | BuildingLimit |
| # buildings allowed | |
| int | TotalUnitLimit |
| # total unit number allowed | |
| int | Score |
| Points for killing ... | |
| int | TotalUnits |
| int | TotalBuildings |
| int | TotalResources [MaxCosts] |
| int | TotalRazings |
| int | TotalKills |
| How many unit killed. | |
| Uint32 | Color |
| color of units on minimap | |
| CUnitColors | UnitColors |
| Unit colors for new units. | |
| CAllow | Allow |
| Allowed for player. | |
#include "player.h"
This structure contains all informations 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.
Name of the player used for displays and network game. It is restricted to 15 characters plus final zero.
Type of the player. This field is setup from the level (map). We support currently PlayerNeutral, PlayerNobody, PlayerComputer, PlayerPerson, PlayerRescuePassive and PlayerRescueActive.
AI name for computer. This field is setup from the map. Used to select the AI for the computer player.
Team of player. Selected during network game setup. All players of the same team are allied and enemy to all other teams.
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.
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.
A bit field which 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::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.
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.
AI structure pointer. Please look at PlayerAi for more informations.
A table of all (CPlayer::TotalNumUnits) units of the player.
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.
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.
Number of food units allowed. Player can't train more CPlayer::NumFoodUnits than this.
Number of buildings allowed. Player can't build more CPlayer::NumBuildings than this.
Number of total units allowed. Player can't have more CPlayer::NumFoodUnits+CPlayerNumBuildings=CPlayerTotalNumUnits this.
Total number of points. You can get points for killing units, destroying buildings ...
Total number of units made.
Total number of buildings made.
CPlayer::TotalResources[MaxCosts]
Total number of resources collected.
Total number of buildings destroyed.
Total number of kills.
Color of units of this player on the minimap. Index number into the global palette.
Unit colors of this player. Contains the hardware dependent pixel values for the player colors (palette index #208-#211). Setup from the global palette.
Contains which unit-types are allowed for the player. Possible values are:
Definition at line 258 of file player.h.
| void CPlayer::SetStartView | ( | int | x, | |
| int | y | |||
| ) | [inline] |
| void CPlayer::SetEnergyProductionRate | ( | int | v | ) | [inline] |
| int CPlayer::GetEnergyProductionRate | ( | ) | [inline] |
| void CPlayer::SetMagmaProductionRate | ( | int | v | ) | [inline] |
| int CPlayer::GetMagmaProductionRate | ( | ) | [inline] |
| void CPlayer::SetEnergyStored | ( | int | v | ) | [inline] |
Definition at line 290 of file player.h.
References CYCLES_PER_SECOND, EnergyCost, and StoredResources.
| int CPlayer::GetEnergyStored | ( | ) | [inline] |
Definition at line 291 of file player.h.
References CYCLES_PER_SECOND, EnergyCost, and StoredResources.
| void CPlayer::SetMagmaStored | ( | int | v | ) | [inline] |
Definition at line 292 of file player.h.
References CYCLES_PER_SECOND, MagmaCost, and StoredResources.
| int CPlayer::GetMagmaStored | ( | ) | [inline] |
Definition at line 293 of file player.h.
References CYCLES_PER_SECOND, MagmaCost, and StoredResources.
| void CPlayer::SetEnergyStorageCapacity | ( | int | v | ) | [inline] |
Definition at line 295 of file player.h.
References CYCLES_PER_SECOND, EnergyCost, and StorageCapacity.
| int CPlayer::GetEnergyStorageCapacity | ( | ) | [inline] |
Definition at line 296 of file player.h.
References CYCLES_PER_SECOND, EnergyCost, and StorageCapacity.
| void CPlayer::SetMagmaStorageCapacity | ( | int | v | ) | [inline] |
Definition at line 297 of file player.h.
References CYCLES_PER_SECOND, MagmaCost, and StorageCapacity.
| int CPlayer::GetMagmaStorageCapacity | ( | ) | [inline] |
Definition at line 298 of file player.h.
References CYCLES_PER_SECOND, MagmaCost, and StorageCapacity.
| void CPlayer::AddToUnitsConsumingResources | ( | CUnit * | unit, | |
| int | costs[MaxCosts] | |||
| ) |
Add to UnitsConsumingResources
Definition at line 132 of file player.cpp.
References Assert, RequestedUtilizationRate, UnitsConsumingResourcesActual, and UnitsConsumingResourcesRequested.
Referenced by HandleActionTrain(), MoveToLocation(), RebuildUnitsConsumingResourcesList(), and StartBuilding().
| void CPlayer::RemoveFromUnitsConsumingResources | ( | CUnit * | unit | ) |
Remove from UnitsConsumingResources
Definition at line 155 of file player.cpp.
References ActualUtilizationRate, MaxCosts, RequestedUtilizationRate, UnitsConsumingResourcesActual, and UnitsConsumingResourcesRequested.
Referenced by CommandCancelTraining(), HandleActionBuilt(), HandleActionTrain(), RepairUnit(), and UnitRemoveConsumingResources().
| void CPlayer::UpdateUnitsConsumingResources | ( | CUnit * | unit, | |
| int | costs[MaxCosts] | |||
| ) |
Update costs for unit in UnitsConsumingResources
Definition at line 174 of file player.cpp.
References ActualUtilizationRate, and UnitsConsumingResourcesActual.
Referenced by PlayersEachCycle().
| void CPlayer::RebuildUnitsConsumingResourcesList | ( | ) |
Go through the list of units owned by the player and rebuild the UnitsConsumingResources list.
Definition at line 226 of file player.cpp.
References AddToUnitsConsumingResources(), CUnitType::BuilderOutside, CalculateRequestedAmount(), MaxCosts, CUnit::Orders, CUnit::Player, CUnitType::ProductionCosts, CUnit::SubAction, TotalNumUnits, CUnit::Type, UnitActionBuilt, UnitActionRepair, UnitActionTrain, and Units.
Referenced by LoadGame().
| void CPlayer::ClearResourceVariables | ( | ) |
Clear all resource state variables.
Definition at line 248 of file player.cpp.
References ActualUtilizationRate, ProductionRate, RequestedUtilizationRate, StorageCapacity, StoredResources, UnitsConsumingResourcesActual, and UnitsConsumingResourcesRequested.
Referenced by Clear().
| void CPlayer::SetTotalEnergy | ( | int | v | ) | [inline] |
Definition at line 327 of file player.h.
References CYCLES_PER_SECOND, EnergyCost, and TotalResources.
| int CPlayer::GetTotalEnergy | ( | ) | [inline] |
Definition at line 328 of file player.h.
References CYCLES_PER_SECOND, EnergyCost, and TotalResources.
| void CPlayer::SetTotalMagma | ( | int | v | ) | [inline] |
Definition at line 329 of file player.h.
References CYCLES_PER_SECOND, MagmaCost, and TotalResources.
| int CPlayer::GetTotalMagma | ( | ) | [inline] |
Definition at line 330 of file player.h.
References CYCLES_PER_SECOND, MagmaCost, and TotalResources.
| void CPlayer::SetName | ( | const std::string & | name | ) |
Clear turn related player data.
Change player name.
| name | New name. |
Definition at line 642 of file player.cpp.
References Name.
Referenced by CclPlayer(), CreateGame(), CreatePlayer(), NetworkConnectSetupGame(), and ReplayEachCycle().
| void CPlayer::Clear | ( | ) |
Set a resource of the player.
Clear all player data excepts members which don't change.
The fields that are not cleared are UnitLimit, BuildingLimit, TotalUnitLimit and Allow.
Definition at line 653 of file player.cpp.
References Ai, AiEnabled, AiName, Allied, ClearResourceVariables(), Color, Enemy, Index, Name, NumBuildings, Score, SharedVision, StartX, StartY, Team, TotalBuildings, TotalKills, TotalNumUnits, TotalRazings, TotalResources, TotalUnits, Type, Units, and UnitTypesCount.
Referenced by CleanPlayers().
| void CPlayer::SetResource | ( | int | resource, | |
| int | value | |||
| ) |
Check if the unit-type didn't break any unit limits and supply/demand.
| int CPlayer::CheckLimits | ( | const CUnitType * | type | ) | const |
Does the player have units of that type.
Check if the unit-type didn't break any unit limits.
| type | Type of unit. |
Definition at line 698 of file player.cpp.
References _, AiEnabled, Allow, CUnitType::Building, BuildingLimit, Notify(), NotifyYellow, NumBuildings, NumUnits, CUnitType::Slot, TotalNumUnits, TotalUnitLimit, UnitLimit, UnitMax, CAllow::Units, and UnitTypesCount.
Referenced by AiCheckingWork(), CheckCanBuild(), CommandTrainUnit(), and HandleActionTrain().
| int CPlayer::HaveUnitTypeByType | ( | const CUnitType * | type | ) | const |
Does the player have units of that type.
Have unit of type.
| type | Type of unit. |
Definition at line 738 of file player.cpp.
References CUnitType::Slot, and UnitTypesCount.
| int CPlayer::HaveUnitTypeByIdent | ( | const std::string & | ident | ) | const |
Notify player about a problem.
Have unit of type.
| ident | Identifier of unit-type that should be lookuped. |
Definition at line 752 of file player.cpp.
References CUnitType::Slot, UnitTypeByIdent(), and UnitTypesCount.
Referenced by ButtonCheckUnitsAnd(), and ButtonCheckUnitsOr().
| void CPlayer::Notify | ( | int | type, | |
| int | x, | |||
| int | y, | |||
| const char * | fmt, | |||
| ... | ||||
| ) | const |
Notify player about a problem.
| type | Problem type | |
| x | Map X tile position | |
| y | Map Y tile position | |
| fmt | Message format | |
| ... | Message varargs |
Definition at line 909 of file player.cpp.
References CMinimap::AddEvent(), IsTeamed(), CUserInterface::Minimap, Name, SetMessageEvent(), and UI.
Referenced by CheckCanBuild(), CheckLimits(), DoNextReplay(), HandleActionBuilt(), HandleActionSpellCast(), HandleActionTrain(), HitUnit(), MoveToLocation(), and StartBuilding().
| bool CPlayer::IsEnemy | ( | const CPlayer * | x | ) | const |
Check if the player is an enemy
Definition at line 938 of file player.cpp.
Referenced by AiEnemyUnitsInDistance(), AttackUnitsInDistance(), DrawDecoration(), DrawUnitSelection(), EnemyOnMapTile(), FindRangeAttack(), GatherResource(), and IsEnemy().
| bool CPlayer::IsEnemy | ( | const CUnit * | x | ) | const |
Check if the unit is an enemy
Definition at line 946 of file player.cpp.
References IsEnemy(), and CUnit::Player.
| bool CPlayer::IsAllied | ( | const CPlayer * | x | ) | const |
Check if the player is an ally
Definition at line 954 of file player.cpp.
Referenced by DrawDecoration(), GatherResource(), CUnit::IsAllied(), IsAllied(), SendRepair(), and UIHandleMouseMove().
| bool CPlayer::IsAllied | ( | const CUnit * | x | ) | const |
Check if the unit is an ally
Definition at line 962 of file player.cpp.
References IsAllied(), and CUnit::Player.
| bool CPlayer::IsSharedVision | ( | const CPlayer * | x | ) | const |
Check if the player shares vision with the player
Definition at line 970 of file player.cpp.
References Index, and SharedVision.
Referenced by IsSharedVision().
| bool CPlayer::IsSharedVision | ( | const CUnit * | x | ) | const |
Check if the player shares vision with the unit
Definition at line 978 of file player.cpp.
References IsSharedVision(), and CUnit::Player.
| bool CPlayer::IsBothSharedVision | ( | const CPlayer * | x | ) | const |
Check if the both players share vision
Definition at line 986 of file player.cpp.
References Index, and SharedVision.
Referenced by CommandSharedVision(), IsBothSharedVision(), CUnit::IsVisible(), UnitsOnTileMarkSeen(), and UnitsOnTileUnmarkSeen().
| bool CPlayer::IsBothSharedVision | ( | const CUnit * | x | ) | const |
Check if the player and the unit share vision
Definition at line 995 of file player.cpp.
References IsBothSharedVision(), and CUnit::Player.
| bool CPlayer::IsTeamed | ( | const CPlayer * | x | ) | const |
Check if the player is teamed
Definition at line 1003 of file player.cpp.
References Team.
Referenced by AddToGroup(), CButtonPanel::DoClicked(), DrawUnitSelection(), IsTeamed(), NetworkEvent(), Notify(), UIHandleButtonDown(), UIHandleButtonUp(), and CButtonPanel::Update().
| bool CPlayer::IsTeamed | ( | const CUnit * | x | ) | const |
Check if the unit is teamed
Definition at line 1011 of file player.cpp.
References IsTeamed(), and CUnit::Player.
| int CPlayer::Index |
player as number
Definition at line 261 of file player.h.
Referenced by AiCanNotBuild(), AiFindAvailableUnitTypeEquiv(), AiHelpMe(), AiInit(), AiMoveUnitInTheWay(), AiPlanAttack(), AiResourceManager(), AiTrainingComplete(), AiUnitKilled(), AiWorkComplete(), CUnit::AssignToPlayer(), CclAiDebugPlayer(), CclAiDump(), CclAiPlayer(), CclDiplomacy(), CclGetNumUnitsAt(), CclIfNearUnit(), CclIfRescuedNearUnit(), CclKillUnitAt(), CclOrderUnit(), CclPlayer(), CclSharedVision(), CUnit::ChangeOwner(), ChangeTeamSelectedUnits(), Clear(), CommandLog(), CreatePlayer(), DoRightButton(), DrawBuildingCursor(), DrawConstruction(), CIcon::DrawIcon(), DrawInfoPanelNoneSelected(), DrawInformations(), CViewport::DrawMapFogOfWar(), DrawUnitOn(), DrawUnitSelection(), HandleActionDie(), InitPlayers(), InputKey(), IsAllied(), CUnit::IsBothSharedVision(), IsBothSharedVision(), CUnit::IsEnemy(), IsEnemy(), CUnit::IsSharedVision(), IsSharedVision(), IsTileRadarVisible(), CMap::IsTileVisible(), CUnit::IsVisible(), CUnit::IsVisibleAsGoal(), CUnit::IsVisibleInViewport(), CUnit::IsVisibleOnMinimap(), LetUnitDie(), MapMarkTileRadar(), MapMarkTileRadarJammer(), MapMarkTileSight(), MapSight(), MapUnmarkTileRadar(), MapUnmarkTileRadarJammer(), MapUnmarkTileSight(), NetworkChatMessage(), NetworkEvent(), NetworkQuit(), NetworkSendCommands(), SavePlayers(), SaveReplay(), SaveUnit(), ShowUnitInfo(), StartReplay(), TriggerGetPlayer(), UIHandleMouseMove(), UnitActions(), UnitGoesOutOfFog(), UnitGoesUnderFog(), UnitsOnTileMarkSeen(), and UnitsOnTileUnmarkSeen().
| std::string CPlayer::Name |
name of non computer
Definition at line 262 of file player.h.
Referenced by Clear(), CreatePlayer(), DebugPlayers(), InputKey(), Notify(), SavePlayers(), SetName(), and StartReplay().
| int CPlayer::Type |
type of player (human,computer,...)
Definition at line 264 of file player.h.
Referenced by AiCanNotBuild(), AiCanNotReach(), AiNeedMoreSupply(), AiTrainingComplete(), AiUnitKilled(), AiWorkComplete(), AttackUnitsInReactRange(), CanBuildUnitType(), CclPlayer(), Clear(), CommandQuit(), CreatePlayer(), DebugPlayers(), DrawDecoration(), DrawInformations(), DrawUnitInfo(), HandleCheats(), InitPlayers(), CUnit::IsVisibleAsGoal(), SavePlayers(), UIHandleButtonUp(), UnitFindResource(), UnitGoesOutOfFog(), and UnitGoesUnderFog().
| std::string CPlayer::AiName |
AI for computer.
Definition at line 265 of file player.h.
Referenced by AiInit(), CclPlayer(), Clear(), CreatePlayer(), DebugPlayers(), and SavePlayers().
| int CPlayer::Team |
team of player
Definition at line 268 of file player.h.
Referenced by CclPlayer(), Clear(), CreatePlayer(), GameTypeManTeamVsMachine(), CUnit::IsTeamed(), IsTeamed(), NetworkSendSelection(), and SavePlayers().
| unsigned CPlayer::Enemy |
enemy bit field for this player
Definition at line 269 of file player.h.
Referenced by CclPlayer(), Clear(), CommandDiplomacy(), CommandQuit(), CreatePlayer(), DrawInfoPanelNoneSelected(), CUnit::IsEnemy(), IsEnemy(), and SavePlayers().
| unsigned CPlayer::Allied |
allied bit field for this player
Definition at line 270 of file player.h.
Referenced by AiMoveUnitInTheWay(), CclPlayer(), Clear(), CommandDiplomacy(), CommandQuit(), CreatePlayer(), DrawInfoPanelNoneSelected(), IsAllied(), and SavePlayers().
| unsigned CPlayer::SharedVision |
shared vision bit field
Definition at line 271 of file player.h.
Referenced by CclPlayer(), Clear(), CommandSharedVision(), GameTypeLeftVsRight(), GameTypeManTeamVsMachine(), GameTypeManVsMachine(), GameTypeTopVsBottom(), CUnit::IsBothSharedVision(), IsBothSharedVision(), CUnit::IsSharedVision(), IsSharedVision(), IsTileRadarVisible(), CMap::IsTileVisible(), and SavePlayers().
| int CPlayer::StartX |
map tile start X position
Definition at line 273 of file player.h.
Referenced by CclPlayer(), Clear(), CreateGame(), EditorCallbackButtonDown(), GameTypeLeftVsRight(), SavePlayers(), and SetStartView().
| int CPlayer::StartY |
map tile start Y position
Definition at line 274 of file player.h.
Referenced by CclPlayer(), Clear(), CreateGame(), EditorCallbackButtonDown(), GameTypeTopVsBottom(), SavePlayers(), and SetStartView().
| std::map<CUnit *, int *> CPlayer::UnitsConsumingResourcesActual |
Definition at line 277 of file player.h.
Referenced by AddToUnitsConsumingResources(), ClearResourceVariables(), DoRepair(), HandleActionBuilt(), HandleActionTrain(), PlayersEachCycle(), RemoveFromUnitsConsumingResources(), and UpdateUnitsConsumingResources().
| std::map<CUnit *, int *> CPlayer::UnitsConsumingResourcesRequested |
Definition at line 278 of file player.h.
Referenced by AddToUnitsConsumingResources(), CalculateCosts(), ClearResourceVariables(), MaxRate(), RemoveFromUnitsConsumingResources(), and UniqueNeeds().
| int CPlayer::ProductionRate[MaxCosts] |
Rate that resources are produced.
Definition at line 279 of file player.h.
Referenced by AiAssignHarvester(), AiCheckCosts(), AiCheckRepair(), AvailableResourcesRate(), CclPlayer(), ClearResourceVariables(), DrawResources(), GatherResource(), GetEnergyProductionRate(), GetMagmaProductionRate(), LetUnitDie(), PlayersEachCycle(), SavePlayers(), SetEnergyProductionRate(), SetMagmaProductionRate(), UnitRemoveConsumingResources(), and UpdateForNewUnit().
| int CPlayer::ActualUtilizationRate[MaxCosts] |
Rate that resources are used.
Definition at line 280 of file player.h.
Referenced by ClearResourceVariables(), PlayersEachCycle(), RemoveFromUnitsConsumingResources(), and UpdateUnitsConsumingResources().
| int CPlayer::RequestedUtilizationRate[MaxCosts] |
Rate that resources are used.
Definition at line 281 of file player.h.
Referenced by AddToUnitsConsumingResources(), ClearResourceVariables(), DrawResources(), ExtraProduction(), RemoveFromUnitsConsumingResources(), and SpecificEfficiency().
| int CPlayer::StoredResources[MaxCosts] |
Amount of resources in storage.
Definition at line 282 of file player.h.
Referenced by AiAssignHarvester(), AiCheckCosts(), AiCheckRepair(), AvailableResourcesRate(), CclPlayer(), ClearResourceVariables(), DrawResources(), GetEnergyStored(), GetMagmaStored(), LetUnitDie(), PlayersEachCycle(), SavePlayers(), SetEnergyStored(), and SetMagmaStored().
| int CPlayer::StorageCapacity[MaxCosts] |
Storage capacity of resources.
Definition at line 283 of file player.h.
Referenced by CclPlayer(), ClearResourceVariables(), DrawResources(), GetEnergyStorageCapacity(), GetMagmaStorageCapacity(), LetUnitDie(), PlayersEachCycle(), SavePlayers(), SetEnergyStorageCapacity(), SetMagmaStorageCapacity(), and UpdateForNewUnit().
| int CPlayer::UnitTypesCount[UnitTypeMax] |
total units of unit-type
Definition at line 307 of file player.h.
Referenced by AiCheckUnits(), AiCountUnitBuilders(), AiMakeUnit(), AiRepairUnit(), CUnit::AssignToPlayer(), CclAiWait(), CclUnit(), CUnit::ChangeOwner(), CheckLimits(), Clear(), CreatePlayer(), FindPlayerUnitsByType(), HandleActionBuilt(), HaveUnitTypeByIdent(), HaveUnitTypeByType(), StartBuilding(), and UnitLost().
handle AI on local computer
Definition at line 309 of file player.h.
Referenced by CclPlayer(), CheckCanBuild(), CheckLimits(), Clear(), CreatePlayer(), DebugPlayers(), DoActionMove(), EnterTransporter(), HandleActionBuilt(), HandleActionSpellCast(), HandleActionTrain(), HandleCheats(), HitUnit(), MoveToLocation(), PlayersEachCycle(), PlayersEachSecond(), PlayersInitAi(), SavePlayers(), SelectTargetUnitsOfAutoCast(), StartBuilding(), and UnitLost().
Ai structure pointer.
Definition at line 310 of file player.h.
Referenced by AiCanNotBuild(), AiCanNotMove(), AiCanNotReach(), AiEachCycle(), AiEachSecond(), AiHelpMe(), AiInit(), AiMoveUnitInTheWay(), AiNeedMoreSupply(), AiTrainingComplete(), AiUnitKilled(), AiWorkComplete(), CclDefineAiPlayer(), CleanAi(), Clear(), and HandleCheats().
| CUnit* CPlayer::Units[UnitMax] |
units of this player
Definition at line 312 of file player.h.
Referenced by AiAssignFreeUnitsToForce(), AiCheckMagic(), AiCheckRepair(), AiCollectResources(), AiPlanAttack(), AiSendExplorers(), CUnit::AssignToPlayer(), CclKillUnit(), CclPlayer(), CUnit::ChangeOwner(), Clear(), CreatePlayer(), FindIdleWorker(), FindPlayerUnitsByType(), RebuildUnitsConsumingResourcesList(), SaveUpgrades(), and UnitLost().
total # units for units' list
Definition at line 313 of file player.h.
Referenced by AiAssignFreeUnitsToForce(), AiCheckMagic(), AiCheckRepair(), AiCollectResources(), AiPlanAttack(), AiSendExplorers(), CUnit::AssignToPlayer(), CclGetUnits(), CclKillUnit(), CUnit::ChangeOwner(), CheckLimits(), Clear(), CreatePlayer(), FindIdleWorker(), FindPlayerUnitsByType(), RebuildUnitsConsumingResourcesList(), and UnitLost().
# buildings
Definition at line 314 of file player.h.
Referenced by CUnit::AssignToPlayer(), CUnit::ChangeOwner(), CheckLimits(), Clear(), CreatePlayer(), and UnitLost().
# food units allowed
Definition at line 316 of file player.h.
Referenced by CclPlayer(), CclSetAllPlayersUnitLimit(), CheckLimits(), and SavePlayers().
# buildings allowed
Definition at line 317 of file player.h.
Referenced by CclPlayer(), CclSetAllPlayersBuildingLimit(), CheckLimits(), and SavePlayers().
# total unit number allowed
Definition at line 318 of file player.h.
Referenced by CclPlayer(), CclSetAllPlayersTotalUnitLimit(), CheckLimits(), and SavePlayers().
| int CPlayer::Score |
Points for killing ...
Definition at line 320 of file player.h.
Referenced by Capture::Cast(), Polymorph::Cast(), CclPlayer(), Clear(), CreatePlayer(), HitUnit(), and SavePlayers().
Definition at line 321 of file player.h.
Referenced by CUnit::AssignToPlayer(), CclPlayer(), CUnit::ChangeOwner(), Clear(), and SavePlayers().
Definition at line 322 of file player.h.
Referenced by CUnit::AssignToPlayer(), CclPlayer(), CUnit::ChangeOwner(), Clear(), and SavePlayers().
| int CPlayer::TotalResources[MaxCosts] |
Definition at line 323 of file player.h.
Referenced by CclPlayer(), Clear(), GetTotalEnergy(), GetTotalMagma(), PlayersEachCycle(), SavePlayers(), SetTotalEnergy(), and SetTotalMagma().
Definition at line 324 of file player.h.
Referenced by Capture::Cast(), Polymorph::Cast(), CclPlayer(), Clear(), HitUnit(), and SavePlayers().
How many unit killed.
Definition at line 325 of file player.h.
Referenced by Capture::Cast(), Polymorph::Cast(), CclPlayer(), Clear(), HitUnit(), and SavePlayers().
| Uint32 CPlayer::Color |
color of units on minimap
Definition at line 332 of file player.h.
Referenced by CclPlayer(), Clear(), CreatePlayer(), DrawUnitOn(), DrawUnitSelection(), and SavePlayers().
Unit colors for new units.
Definition at line 334 of file player.h.
Referenced by CUnit::AssignToPlayer(), CclUnit(), CreateGame(), GraphicPlayerPixels(), and SetPlayersPalette().
Allowed for player.
Change player name
Definition at line 337 of file player.h.
Referenced by AllowUnitId(), CheckLimits(), and UnitIdAllowed().
1.5.6