Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
Player Class Reference

#include <Player.h>

Inherits Snapshot.

Public Types

typedef std::list< TeamPrototype * > PlayerTeamList
 

Public Member Functions

 Player (Int playerIndex)
 
virtual ~Player ()
 
void update ()
 player update opportunity
 
void newMap ()
 player after map loaded opportunity
 
void init (const PlayerTemplate *pt)
 
void initFromDict (const Dict *d)
 
void setDefaultTeam (void)
 
UnicodeString getPlayerDisplayName ()
 
NameKeyType getPlayerNameKey () const
 
AsciiString getSide () const
 
AsciiString getBaseSide () const
 
const PlayerTemplategetPlayerTemplate () const
 
const HandicapgetHandicap () const
 return the Player's Handicap sub-object
 
HandicapgetHandicap ()
 
MoneygetMoney ()
 return the Player's Money sub-object
 
const MoneygetMoney () const
 
UnsignedInt getSupplyBoxValue ()
 Many things can affect the alue of a crate, but at heart it is a GlobalData ratio.
 
EnergygetEnergy ()
 
const EnergygetEnergy () const
 
void addPowerBonus (Object *obj)
 
void removePowerBonus (Object *obj)
 
ResourceGatheringManagergetResourceGatheringManager ()
 
TunnelTrackergetTunnelSystem ()
 
Color getPlayerColor () const
 
Color getPlayerNightColor () const
 
PlayerType getPlayerType () const
 return the type of controller
 
void setPlayerType (PlayerType t, Bool skirmish)
 
PlayerIndex getPlayerIndex () const
 
PlayerMaskType getPlayerMask () const
 return a bitmask that is unique to this player.
 
Bool allowedToBuild (const ThingTemplate *tmplate) const
 
Bool canBuild (const ThingTemplate *tmplate) const
 true if we have the prereqs for this item
 
Bool canAffordBuild (const ThingTemplate *whatToBuild) const
 
Bool canBuildMoreOfType (const ThingTemplate *whatToBuild) const
 
GameDifficulty getPlayerDifficulty (void) const
 Difficulty level for this player.
 
ObjectfindNaturalCommandCenter ()
 
ObjectfindAnyExistingObjectWithThingTemplate (const ThingTemplate *thing)
 
ObjectfindMostReadyShortcutSpecialPowerOfType (SpecialPowerType spType)
 
ObjectfindMostReadyShortcutWeaponForThing (const ThingTemplate *thing, UnsignedInt &mostReadyPercentage)
 
ObjectfindMostReadyShortcutSpecialPowerForThing (const ThingTemplate *thing, UnsignedInt &mostReadyPercentage)
 
Bool hasAnyShortcutSpecialPower ()
 
Int countReadyShortcutSpecialPowersOfType (SpecialPowerType spType)
 
Bool hasScience (ScienceType t) const
 return t if the player has the given science, either intrinsically, via specialization, or via capture.
 
Bool isScienceDisabled (ScienceType t) const
 Can't purchase this science because of script reasons.
 
Bool isScienceHidden (ScienceType t) const
 This science is effectively hidden due to script reasons.
 
void setScienceAvailability (ScienceType science, ScienceAvailabilityType type)
 
ScienceAvailabilityType getScienceAvailabilityTypeFromString (const AsciiString &name)
 
Bool hasPrereqsForScience (ScienceType t) const
 return t iff the player has all sciences that are prereqs for knowing the given science
 
Bool hasUpgradeComplete (const UpgradeTemplate *upgradeTemplate)
 does player have totally done and produced upgrade
 
Bool hasUpgradeComplete (UpgradeMaskType testMask)
 does player have totally done and produced upgrade
 
UpgradeMaskType getCompletedUpgradeMask () const
 get list of upgrades that are completed
 
Bool hasUpgradeInProduction (const UpgradeTemplate *upgradeTemplate)
 does player have this upgrade in progress right now
 
UpgradeaddUpgrade (const UpgradeTemplate *upgradeTemplate, UpgradeStatusType status)
 add upgrade, or update existing upgrade status
 
void removeUpgrade (const UpgradeTemplate *upgradeTemplate)
 remove thsi upgrade from us
 
UpgradefindUpgrade (const UpgradeTemplate *upgradeTemplate)
 
void onUpgradeCompleted (const UpgradeTemplate *upgradeTemplate)
 An upgrade just finished, do things like tell all objects to recheck UpgradeModules.
 
void onUpgradeRemoved ()
 An upgrade just got removed, this doesn't do anything now.
 
void onPowerBrownOutChange (Bool brownOut)
 one of my command centers just fired a special power, let us reset timers for all command centers.
 
void resetOrStartSpecialPowerReadyFrame (const SpecialPowerTemplate *temp)
 my new command center wants to init his timers to the status quo
 
UnsignedInt getOrStartSpecialPowerReadyFrame (const SpecialPowerTemplate *temp)
 
void expressSpecialPowerReadyFrame (const SpecialPowerTemplate *temp, UnsignedInt frame)
 
void addNewSharedSpecialPowerTimer (const SpecialPowerTemplate *temp, UnsignedInt frame)
 
void addRadar (Bool disableProof)
 One more producer of Radar exists.
 
void removeRadar (Bool disableProof)
 One less thing produces radar.
 
void disableRadar ()
 No matter how many radar producers I have, I do not have radar.
 
void enableRadar ()
 remove the restriction imposed by disableRadar
 
Bool hasRadar () const
 A positive number of radar producers, plus my radar is not disabled.
 
Bool okToPlayRadarEdgeSound ()
 just like it "sounds"
 
void changeBattlePlan (BattlePlanStatus plan, Int delta, BattlePlanBonuses *bonus)
 
Int getNumBattlePlansActive () const
 
Int getBattlePlansActiveSpecific (BattlePlanStatus plan) const
 
void applyBattlePlanBonusesForObject (Object *obj) const
 
void removeBattlePlanBonusesForObject (Object *obj) const
 
void applyBattlePlanBonusesForPlayerObjects (const BattlePlanBonuses *bonus)
 
Bool doesObjectQualifyForBattlePlan (Object *obj) const
 
void friend_applyDifficultyBonusesForObject (Object *obj, Bool apply) const
 
void removeKindOfProductionCostChange (KindOfMaskType kindOf, Real percent)
 Decrement the ref counter on the typeof production list node.
 
void addKindOfProductionCostChange (KindOfMaskType kindOf, Real percent)
 add type of production cost change (Used for upgrades)
 
Real getProductionCostChangeBasedOnKindOf (KindOfMaskType kindOf) const
 Returns production cost change based on typeof (Used for upgrades)
 
Real getProductionCostChangePercent (AsciiString buildTemplateName) const
 
Real getProductionTimeChangePercent (AsciiString buildTemplateName) const
 
VeterancyLevel getProductionVeterancyLevel (AsciiString buildTemplateName) const
 
void friend_setSkillset (Int skillSet)
 
void becomingTeamMember (Object *obj, Bool yes)
 
void becomingLocalPlayer (Bool yes)
 
Bool isLocalPlayer () const
 Is this player the local player?
 
void setListInScoreScreen (Bool listInScoreScreen)
 this player should be listed in the score screen.
 
Bool getListInScoreScreen ()
 return TRUE if this player should be listed in the score screen.
 
void onUnitCreated (Object *factory, Object *unit)
 A unit was just created and is ready to control.
 
void preTeamDestroy (const Team *team)
 A team is about to be destroyed.
 
Bool isSupplySourceSafe (Int minSupplies)
 Is the nearest supply source safe?
 
Bool isSupplySourceAttacked (void)
 Is a supply source attacked?
 
void setTeamDelaySeconds (Int delay)
 Set delay between team production.
 
void guardSupplyCenter (Team *team, Int minSupplies)
 Have the team guard a supply center.
 
virtual Bool computeSuperweaponTarget (const SpecialPowerTemplate *power, Coord3D *pos, Int playerNdx, Real weaponRadius)
 Calculates best pos for weapon given radius.
 
PlayergetCurrentEnemy (void)
 Get the enemy an ai player is currently focused on. NOTE - Can be NULL.
 
Bool isSkirmishAIPlayer (void)
 Is this player a skirmish ai player?
 
virtual Bool checkBridges (Object *unit, Waypoint *way)
 Have the ai check for bridges.
 
virtual Bool getAiBaseCenter (Coord3D *pos)
 Get the center of the ai's base.
 
virtual void repairStructure (ObjectID structureID)
 Have the ai check for bridges.
 
void onStructureCreated (Object *builder, Object *structure)
 a structuer was just created, but is under construction
 
void onStructureConstructionComplete (Object *builder, Object *structure, Bool isRebuild)
 a structure that was under construction has become completed
 
void onStructureUndone (Object *structure)
 a structure that was created has been pre-emptively removed and shouldn't be counted in the score.
 
void countObjectsByThingTemplate (Int numTmplates, const ThingTemplate *const *things, Bool ignoreDead, Int *counts, Bool ignoreUnderConstruction=TRUE) const
 
Int countBuildings (void)
 
Int countObjects (KindOfMaskType setMask, KindOfMaskType clearMask)
 
ObjectfindClosestByKindOf (Object *queryObject, KindOfMaskType setMask, KindOfMaskType clearMask)
 Returns the closest of a given type to the given object.
 
Bool hasAnyBuildings (void) const
 
Bool hasAnyBuildings (KindOfMaskType kindOf) const
 
Bool hasAnyUnits (void) const
 
Bool hasAnyObjects (void) const
 
Bool hasAnyBuildFacility (void) const
 
void updateTeamStates (void)
 
void healAllObjects ()
 
void iterateObjects (ObjectIterateFunc func, void *userData) const
 
TeamgetDefaultTeam ()
 
const TeamgetDefaultTeam () const
 
void setBuildList (BuildListInfo *pBuildList)
 sets the build list.
 
BuildListInfogetBuildList (void)
 returns the build list. (build list might be modified by the solo AI)
 
void addToBuildList (Object *obj)
 Adds this to the build list. Used for factories placed instead of in build list.
 
void addToPriorityBuildList (AsciiString templateName, Coord3D *pos, Real angle)
 Adds this to the build list. Used for factories placed instead of in build list.
 
Relationship getRelationship (const Team *that) const
 get the relationship between this->that.
 
void setPlayerRelationship (const Player *that, Relationship r)
 set the relationship between this->that. (note that this doesn't affect the that->this relationship.)
 
Bool removePlayerRelationship (const Player *that)
 
void setTeamRelationship (const Team *that, Relationship r)
 
Bool removeTeamRelationship (const Team *that)
 
void addTeamToList (TeamPrototype *team)
 
void removeTeamFromList (TeamPrototype *team)
 
const PlayerTeamListgetPlayerTeams () const
 
Int getMpStartIndex (void)
 
void setUnitsShouldHunt (Bool unitsShouldHunt, CommandSourceType source)
 Set that all units should begin hunting.
 
Bool getUnitsShouldHunt () const
 
void setUnitsVisionSpied (Bool setting, KindOfMaskType whichUnits, PlayerIndex byWhom)
 All of our units are new spied upon; they sight for the given enemy.
 
void killPlayer (void)
 Destroy all of the teams for this player, causing him to DIE.
 
void setObjectsEnabled (AsciiString templateTypeToAffect, Bool enable)
 Enabled/Disable all objects of type templateTypeToAffect.
 
void buildSpecificTeam (TeamPrototype *teamProto)
 Build an instance of a specific team. Gets passed to aiPlayer.
 
void buildSpecificBuilding (const AsciiString &thingName)
 Build an instance of a specific building. Gets passed to aiPlayer.
 
void buildBySupplies (Int minimumCash, const AsciiString &thingName)
 Build a building near a supply dump with at least cash. Gets passed to aiPlayer.
 
void buildSpecificBuildingNearestTeam (const AsciiString &thingName, const Team *team)
 Build an instance of a specific building nearest specified team. Gets passed to aiPlayer.
 
void buildUpgrade (const AsciiString &upgrade)
 Build an upgrade. Gets passed to aiPlayer.
 
void buildBaseDefense (Bool flank)
 Build base defense on front or flank of base. Gets passed to aiPlayer.
 
void buildBaseDefenseStructure (const AsciiString &thingName, Bool flank)
 Build structure type on front or flank of base. Gets passed to aiPlayer.
 
void recruitSpecificTeam (TeamPrototype *teamProto, Real recruitRadius)
 Recruits an instance of a specific team. Gets passed to aiPlayer.
 
Bool calcClosestConstructionZoneLocation (const ThingTemplate *constructTemplate, Coord3D *location)
 Calculates the closest construction zone location based on a template. Gets plassed to aiPlayer.
 
Bool getCanBuildUnits (void)
 Enable/Disable the construction of units.
 
void setCanBuildUnits (Bool canProduce)
 
Bool getCanBuildBase (void)
 Enable/Disable the construction of base buildings.
 
void setCanBuildBase (Bool canProduce)
 
void transferAssetsFromThat (Player *that)
 Transfer all assets from player that to this.
 
void sellEverythingUnderTheSun (void)
 Sell everything this player owns.
 
void garrisonAllUnits (CommandSourceType source)
 
void ungarrisonAllUnits (CommandSourceType source)
 
void setUnitsShouldIdleOrResume (Bool idle)
 
Bool isPlayableSide (void) const
 
Bool isPlayerObserver (void) const
 
Bool isPlayerDead (void) const
 
Bool isPlayerActive (void) const
 
Bool didPlayerPreorder (void) const
 
ScoreKeepergetScoreKeeper (void)
 Grab the scorekeeper so we can score up in here!
 
void processCreateTeamGameMessage (Int hotkeyNum, GameMessage *msg)
 time to create a hotkey team based on this GameMessage
 
void processSelectTeamGameMessage (Int hotkeyNum, GameMessage *msg)
 time to select a hotkey team based on this GameMessage
 
void processAddTeamGameMessage (Int hotkeyNum, GameMessage *msg)
 
void getCurrentSelectionAsAIGroup (AIGroup *group)
 
void setCurrentlySelectedAIGroup (AIGroup *group)
 
void addAIGroupToCurrentSelection (AIGroup *group)
 
SquadgetHotkeySquad (Int squadNumber)
 
Int getSquadNumberForObject (const Object *objToFind) const
 
void removeObjectFromHotkeySquad (Object *objToRemove)
 
void setAttackedBy (Int playerNdx)
 
Bool getAttackedBy (Int playerNdx) const
 
UnsignedInt getAttackedFrame (void)
 
Real getCashBounty () const
 
void setCashBounty (Real percentage)
 
void doBountyForKill (const Object *killer, const Object *victim)
 
AcademyStatsgetAcademyStats ()
 
const AcademyStatsgetAcademyStats () const
 
Bool isLogicalRetaliationModeEnabled () const
 
void setLogicalRetaliationModeEnabled (Bool set)
 
Int getSkillPoints () const
 
Int getSciencePurchasePoints () const
 
Int getRankLevel () const
 
Int getSkillPointsLevelUp () const
 
Int getSkillPointsLevelDown () const
 
UnicodeString getGeneralName () const
 
void setGeneralName (UnicodeString name)
 
Bool setRankLevel (Int level)
 returns TRUE if rank level really changed.
 
Bool addSkillPoints (Int delta)
 returns TRUE if the player gained/lost levels as a result.
 
Bool addSkillPointsForKill (const Object *killer, const Object *victim)
 returns TRUE if the player gained/lost levels as a result.
 
void addSciencePurchasePoints (Int delta)
 
void setSkillPointsModifier (Real expMod)
 
Real getSkillPointsModifier (void) const
 
void resetSciences ()
 reset the sciences to just the intrinsic ones from the playertemplate, if any.
 
void resetRank ()
 reset rank to 1.
 
Bool attemptToPurchaseScience (ScienceType science)
 
Bool grantScience (ScienceType science)
 
Bool isCapableOfPurchasingScience (ScienceType science) const
 
- Public Member Functions inherited from Snapshot
 Snapshot (void)
 
 ~Snapshot (void)
 

Protected Member Functions

virtual void crc (Xfer *xfer)
 
virtual void xfer (Xfer *xfer)
 
virtual void loadPostProcess (void)
 
void deleteUpgradeList (void)
 delete all our upgrades
 

Detailed Description

A "Player" as an entity that contains the persistent info of the Player, as well as containing transient mission data.

Some of the Player's attributes persist between missions, whereas others are "transient" and only have meaning in a mission, wherein they change a lot (current tech tree state, current buildings built, units trained, money, etc). (For clarity of nomenclature, we'll refer to all "persistent" vs "non-persistent" attributes, since "transient" has an unclear duration.)

A "Player" consists of an entity controlling a single set of units in a mission. A Player may be human or computer controlled.

All Players have a (transient) "Player Index" associated which allows us to do some shorthand for representing Players in some cases (mainly in bitfields). This is always a 0-based number (-1 is used as an illegal index). Note that a logical conclusion of this is that it makes it desirable to limit the maximum number of simultaneous Players to 32, but that seems quite reasonable.

All persistent data associated with the Player will be saved to local storage and/or synchronized with one of our servers for online play.

Note, simple accessor methods are omitted for brevity... for now, you may infer them from the data structures.

Note also that the class (and the relevant subclasses) are almost certainly incomplete; a short perusal of the RA2 equivalent class(es) have waaay more tweaky data fields, some of which will probably be necessary (in some form, at some point), some of which won't ever be necessary. Rather than trying to guess at all of them here, we're limiting the initial setup to be the almost-certainly-necessary, filling in the extra things as needed. (Note that most of these will be non-persistent!)

Definition at line 208 of file Player.h.

Member Typedef Documentation

◆ PlayerTeamList

Definition at line 532 of file Player.h.

Constructor & Destructor Documentation

◆ Player()

Player::Player ( Int playerIndex)

Definition at line 303 of file Player.cpp.

◆ ~Player()

Player::~Player ( )
virtual

Definition at line 537 of file Player.cpp.

Member Function Documentation

◆ addAIGroupToCurrentSelection()

void Player::addAIGroupToCurrentSelection ( AIGroup * group)

Select a hotkey team based on this GameMessage

Definition at line 3805 of file Player.cpp.

◆ addKindOfProductionCostChange()

void Player::addKindOfProductionCostChange ( KindOfMaskType kindOf,
Real percent )

add type of production cost change (Used for upgrades)

addTypeOfProductionCostChange adds a production change to the typeof list

Definition at line 3824 of file Player.cpp.

◆ addNewSharedSpecialPowerTimer()

void Player::addNewSharedSpecialPowerTimer ( const SpecialPowerTemplate * temp,
UnsignedInt frame )

Definition at line 3283 of file Player.cpp.

◆ addPowerBonus()

void Player::addPowerBonus ( Object * obj)
inline

Definition at line 244 of file Player.h.

◆ addRadar()

void Player::addRadar ( Bool disableProof)

One more producer of Radar exists.

The parameter object has just aquired a radar

Definition at line 3164 of file Player.cpp.

◆ addSciencePurchasePoints()

void Player::addSciencePurchasePoints ( Int delta)

Definition at line 2587 of file Player.cpp.

◆ addSkillPoints()

Bool Player::addSkillPoints ( Int delta)

returns TRUE if the player gained/lost levels as a result.

Definition at line 2469 of file Player.cpp.

◆ addSkillPointsForKill()

Bool Player::addSkillPointsForKill ( const Object * killer,
const Object * victim )

returns TRUE if the player gained/lost levels as a result.

Definition at line 2494 of file Player.cpp.

◆ addTeamToList()

void Player::addTeamToList ( TeamPrototype * team)

Definition at line 1761 of file Player.cpp.

◆ addToBuildList()

void Player::addToBuildList ( Object * obj)

Adds this to the build list. Used for factories placed instead of in build list.

Definition at line 685 of file Player.cpp.

◆ addToPriorityBuildList()

void Player::addToPriorityBuildList ( AsciiString templateName,
Coord3D * pos,
Real angle )

Adds this to the build list. Used for factories placed instead of in build list.

Definition at line 698 of file Player.cpp.

◆ addUpgrade()

Upgrade * Player::addUpgrade ( const UpgradeTemplate * upgradeTemplate,
UpgradeStatusType status )

add upgrade, or update existing upgrade status

Give the player an upgrade or change status on an existing upgrade entry

Definition at line 3037 of file Player.cpp.

◆ allowedToBuild()

Bool Player::allowedToBuild ( const ThingTemplate * tmplate) const

a convenience function to test the ThingTemplate against the players canBuild flags called by canBuild

Definition at line 2327 of file Player.cpp.

◆ applyBattlePlanBonusesForObject()

void Player::applyBattlePlanBonusesForObject ( Object * obj) const

Definition at line 3597 of file Player.cpp.

◆ applyBattlePlanBonusesForPlayerObjects()

void Player::applyBattlePlanBonusesForPlayerObjects ( const BattlePlanBonuses * bonus)

Definition at line 3625 of file Player.cpp.

◆ attemptToPurchaseScience()

Bool Player::attemptToPurchaseScience ( ScienceType science)

attempt to purchase the science, but use prereqs, and charge points. return true if successful.

Definition at line 2601 of file Player.cpp.

◆ becomingLocalPlayer()

void Player::becomingLocalPlayer ( Bool yes)

this is called when the player becomes the local player (yes==true) or ceases to be the local player (yes==false). you can't stop this from happening; you can only react to it.

Definition at line 1110 of file Player.cpp.

◆ becomingTeamMember()

void Player::becomingTeamMember ( Object * obj,
Bool yes )

the given object has just become (or just ceased to be) a member of one of our teams (or subteams)

Definition at line 1060 of file Player.cpp.

◆ buildBaseDefense()

void Player::buildBaseDefense ( Bool flank)

Build base defense on front or flank of base. Gets passed to aiPlayer.

Definition at line 2351 of file Player.cpp.

◆ buildBaseDefenseStructure()

void Player::buildBaseDefenseStructure ( const AsciiString & thingName,
Bool flank )

Build structure type on front or flank of base. Gets passed to aiPlayer.

Definition at line 2361 of file Player.cpp.

◆ buildBySupplies()

void Player::buildBySupplies ( Int minimumCash,
const AsciiString & thingName )

Build a building near a supply dump with at least cash. Gets passed to aiPlayer.

Definition at line 2381 of file Player.cpp.

◆ buildSpecificBuilding()

void Player::buildSpecificBuilding ( const AsciiString & thingName)

Build an instance of a specific building. Gets passed to aiPlayer.

Definition at line 2371 of file Player.cpp.

◆ buildSpecificBuildingNearestTeam()

void Player::buildSpecificBuildingNearestTeam ( const AsciiString & thingName,
const Team * team )

Build an instance of a specific building nearest specified team. Gets passed to aiPlayer.

Definition at line 2390 of file Player.cpp.

◆ buildSpecificTeam()

void Player::buildSpecificTeam ( TeamPrototype * teamProto)

Build an instance of a specific team. Gets passed to aiPlayer.

Definition at line 2341 of file Player.cpp.

◆ buildUpgrade()

void Player::buildUpgrade ( const AsciiString & upgrade)

Build an upgrade. Gets passed to aiPlayer.

Definition at line 2399 of file Player.cpp.

◆ calcClosestConstructionZoneLocation()

Bool Player::calcClosestConstructionZoneLocation ( const ThingTemplate * constructTemplate,
Coord3D * location )

Calculates the closest construction zone location based on a template. Gets plassed to aiPlayer.

Definition at line 2421 of file Player.cpp.

◆ canAffordBuild()

Bool Player::canAffordBuild ( const ThingTemplate * whatToBuild) const

Definition at line 2959 of file Player.cpp.

◆ canBuild()

Bool Player::canBuild ( const ThingTemplate * tmplate) const

true if we have the prereqs for this item

Definition at line 2912 of file Player.cpp.

◆ canBuildMoreOfType()

Bool Player::canBuildMoreOfType ( const ThingTemplate * whatToBuild) const

Definition at line 2886 of file Player.cpp.

◆ changeBattlePlan()

void Player::changeBattlePlan ( BattlePlanStatus plan,
Int delta,
BattlePlanBonuses * bonus )

Definition at line 3423 of file Player.cpp.

◆ checkBridges()

Bool Player::checkBridges ( Object * unit,
Waypoint * way )
virtual

Have the ai check for bridges.

Do any bridges need repair, and if so repair them.

Definition at line 1563 of file Player.cpp.

◆ computeSuperweaponTarget()

Bool Player::computeSuperweaponTarget ( const SpecialPowerTemplate * power,
Coord3D * retPos,
Int playerNdx,
Real weaponRadius )
virtual

Calculates best pos for weapon given radius.

Find a good spot to fire a superweapon.

Definition at line 1198 of file Player.cpp.

◆ countBuildings()

Int Player::countBuildings ( void )

simply returns the number of buildings owned by this player

Definition at line 1824 of file Player.cpp.

◆ countObjects()

Int Player::countObjects ( KindOfMaskType setMask,
KindOfMaskType clearMask )

simply returns the number of objects owned by this player with a specific KindOfMaskType

Definition at line 1837 of file Player.cpp.

◆ countObjectsByThingTemplate()

void Player::countObjectsByThingTemplate ( Int numTmplates,
const ThingTemplate *const * things,
Bool ignoreDead,
Int * counts,
Bool ignoreUnderConstruction = TRUE ) const

a convenience routine to count the number of owned objects that match a set of ThingTemplates. You input the count and an array of ThingTemplate*, and provide an array of Int of the same size. It fills in the array to the correct counts. This is handy because we must traverse the player's list-of-objects only once.

Definition at line 1808 of file Player.cpp.

◆ countReadyShortcutSpecialPowersOfType()

Int Player::countReadyShortcutSpecialPowersOfType ( SpecialPowerType spType)

Definition at line 1539 of file Player.cpp.

◆ crc()

void Player::crc ( Xfer * xfer)
protectedvirtual

CRC

Implements Snapshot.

Definition at line 3971 of file Player.cpp.

◆ deleteUpgradeList()

void Player::deleteUpgradeList ( void )
protected

delete all our upgrades

Definition at line 2971 of file Player.cpp.

◆ didPlayerPreorder()

Bool Player::didPlayerPreorder ( void ) const
inline

Definition at line 602 of file Player.h.

◆ disableRadar()

void Player::disableRadar ( )

No matter how many radar producers I have, I do not have radar.

Definition at line 3207 of file Player.cpp.

◆ doBountyForKill()

void Player::doBountyForKill ( const Object * killer,
const Object * victim )

Definition at line 2432 of file Player.cpp.

◆ doesObjectQualifyForBattlePlan()

Bool Player::doesObjectQualifyForBattlePlan ( Object * obj) const

Definition at line 3406 of file Player.cpp.

◆ enableRadar()

void Player::enableRadar ( )

remove the restriction imposed by disableRadar

Definition at line 3223 of file Player.cpp.

◆ expressSpecialPowerReadyFrame()

void Player::expressSpecialPowerReadyFrame ( const SpecialPowerTemplate * temp,
UnsignedInt frame )

Definition at line 3315 of file Player.cpp.

◆ findAnyExistingObjectWithThingTemplate()

Object * Player::findAnyExistingObjectWithThingTemplate ( const ThingTemplate * thing)

Definition at line 1514 of file Player.cpp.

◆ findClosestByKindOf()

Object * Player::findClosestByKindOf ( Object * queryObject,
KindOfMaskType setMask,
KindOfMaskType clearMask )

Returns the closest of a given type to the given object.

Definition at line 1850 of file Player.cpp.

◆ findMostReadyShortcutSpecialPowerForThing()

Object * Player::findMostReadyShortcutSpecialPowerForThing ( const ThingTemplate * thing,
UnsignedInt & mostReadyPercentage )

Definition at line 1501 of file Player.cpp.

◆ findMostReadyShortcutSpecialPowerOfType()

Object * Player::findMostReadyShortcutSpecialPowerOfType ( SpecialPowerType spType)

Definition at line 1476 of file Player.cpp.

◆ findMostReadyShortcutWeaponForThing()

Object * Player::findMostReadyShortcutWeaponForThing ( const ThingTemplate * thing,
UnsignedInt & mostReadyPercentage )

Definition at line 1488 of file Player.cpp.

◆ findNaturalCommandCenter()

Object * Player::findNaturalCommandCenter ( )

return the player's command center. (must be one of his "normal" ones, not a captured one.) if he has none, return null. if he has multiple, return one arbitrarily.

Definition at line 1466 of file Player.cpp.

◆ findUpgrade()

Upgrade * Player::findUpgrade ( const UpgradeTemplate * upgradeTemplate)

find upgrade, NOTE, the upgrade may NOT be "complete" and therefore "active", it could be in production This function is for actually retrieving the Upgrade. To test existance, use the fast bit testers hasUpgradeX()

Find an upgrade in our list of upgrades with matching name key

Definition at line 2994 of file Player.cpp.

◆ friend_applyDifficultyBonusesForObject()

void Player::friend_applyDifficultyBonusesForObject ( Object * obj,
Bool apply ) const

Definition at line 3370 of file Player.cpp.

◆ friend_setSkillset()

void Player::friend_setSkillset ( Int skillSet)

Definition at line 2003 of file Player.cpp.

◆ garrisonAllUnits()

void Player::garrisonAllUnits ( CommandSourceType source)
Todo
srj – we should really use iterateAllObjects() here instead, but I have no time to

Definition at line 2179 of file Player.cpp.

◆ getAcademyStats() [1/2]

AcademyStats * Player::getAcademyStats ( )
inline

Definition at line 642 of file Player.h.

◆ getAcademyStats() [2/2]

const AcademyStats * Player::getAcademyStats ( ) const
inline

Definition at line 643 of file Player.h.

◆ getAiBaseCenter()

Bool Player::getAiBaseCenter ( Coord3D * pos)
virtual

Get the center of the ai's base.

Do any bridges need repair, and if so repair them.

Definition at line 1571 of file Player.cpp.

◆ getAttackedBy()

Bool Player::getAttackedBy ( Int playerNdx) const

getAttackedBy

Definition at line 3907 of file Player.cpp.

◆ getAttackedFrame()

UnsignedInt Player::getAttackedFrame ( void )
inline

Definition at line 636 of file Player.h.

◆ getBaseSide()

AsciiString Player::getBaseSide ( ) const
inline

Definition at line 227 of file Player.h.

◆ getBattlePlansActiveSpecific()

Int Player::getBattlePlansActiveSpecific ( BattlePlanStatus plan) const

Definition at line 3497 of file Player.cpp.

◆ getBuildList()

BuildListInfo * Player::getBuildList ( void )
inline

returns the build list. (build list might be modified by the solo AI)

Definition at line 516 of file Player.h.

◆ getCanBuildBase()

Bool Player::getCanBuildBase ( void )
inline

Enable/Disable the construction of base buildings.

Definition at line 582 of file Player.h.

◆ getCanBuildUnits()

Bool Player::getCanBuildUnits ( void )
inline

Enable/Disable the construction of units.

Definition at line 578 of file Player.h.

◆ getCashBounty()

Real Player::getCashBounty ( ) const
inline

Definition at line 638 of file Player.h.

◆ getCompletedUpgradeMask()

UpgradeMaskType Player::getCompletedUpgradeMask ( ) const
inline

get list of upgrades that are completed

Definition at line 314 of file Player.h.

◆ getCurrentEnemy()

Player * Player::getCurrentEnemy ( void )

Get the enemy an ai player is currently focused on. NOTE - Can be NULL.

Get this player's current enemy. NOTE - Can be NULL.

Definition at line 1210 of file Player.cpp.

◆ getCurrentSelectionAsAIGroup()

void Player::getCurrentSelectionAsAIGroup ( AIGroup * group)

Select a hotkey team based on this GameMessage

Definition at line 3741 of file Player.cpp.

◆ getDefaultTeam() [1/2]

Team * Player::getDefaultTeam ( )
inline

return this player's "default" team.

Definition at line 512 of file Player.h.

◆ getDefaultTeam() [2/2]

const Team * Player::getDefaultTeam ( ) const
inline

Definition at line 513 of file Player.h.

◆ getEnergy() [1/2]

Energy * Player::getEnergy ( )
inline

Definition at line 240 of file Player.h.

◆ getEnergy() [2/2]

const Energy * Player::getEnergy ( ) const
inline

Definition at line 241 of file Player.h.

◆ getGeneralName()

UnicodeString Player::getGeneralName ( ) const
inline

Definition at line 668 of file Player.h.

◆ getHandicap() [1/2]

Handicap * Player::getHandicap ( )
inline

Definition at line 232 of file Player.h.

◆ getHandicap() [2/2]

const Handicap * Player::getHandicap ( ) const
inline

return the Player's Handicap sub-object

Definition at line 231 of file Player.h.

◆ getHotkeySquad()

Squad * Player::getHotkeySquad ( Int squadNumber)

Select a hotkey team based on this GameMessage

Definition at line 3765 of file Player.cpp.

◆ getListInScoreScreen()

Bool Player::getListInScoreScreen ( )

return TRUE if this player should be listed in the score screen.

Definition at line 1953 of file Player.cpp.

◆ getMoney() [1/2]

Money * Player::getMoney ( )
inline

return the Player's Money sub-object

Definition at line 235 of file Player.h.

◆ getMoney() [2/2]

const Money * Player::getMoney ( ) const
inline

Definition at line 236 of file Player.h.

◆ getMpStartIndex()

Int Player::getMpStartIndex ( void )
inline

Definition at line 535 of file Player.h.

◆ getNumBattlePlansActive()

Int Player::getNumBattlePlansActive ( ) const
inline

Definition at line 350 of file Player.h.

◆ getOrStartSpecialPowerReadyFrame()

UnsignedInt Player::getOrStartSpecialPowerReadyFrame ( const SpecialPowerTemplate * temp)

Definition at line 3337 of file Player.cpp.

◆ getPlayerColor()

Color Player::getPlayerColor ( ) const
inline

Definition at line 250 of file Player.h.

◆ getPlayerDifficulty()

GameDifficulty Player::getPlayerDifficulty ( void ) const

Difficulty level for this player.

Difficulty level for this player

Definition at line 1551 of file Player.cpp.

◆ getPlayerDisplayName()

UnicodeString Player::getPlayerDisplayName ( )
inline

Definition at line 223 of file Player.h.

◆ getPlayerIndex()

PlayerIndex Player::getPlayerIndex ( ) const
inline

Definition at line 256 of file Player.h.

◆ getPlayerMask()

PlayerMaskType Player::getPlayerMask ( ) const
inline

return a bitmask that is unique to this player.

Definition at line 259 of file Player.h.

◆ getPlayerNameKey()

NameKeyType Player::getPlayerNameKey ( ) const
inline

Definition at line 224 of file Player.h.

◆ getPlayerNightColor()

Color Player::getPlayerNightColor ( ) const
inline

Definition at line 251 of file Player.h.

◆ getPlayerTeams()

const PlayerTeamList * Player::getPlayerTeams ( ) const
inline

Definition at line 533 of file Player.h.

◆ getPlayerTemplate()

const PlayerTemplate * Player::getPlayerTemplate ( ) const
inline

Definition at line 229 of file Player.h.

◆ getPlayerType()

PlayerType Player::getPlayerType ( ) const
inline

return the type of controller

Definition at line 253 of file Player.h.

◆ getProductionCostChangeBasedOnKindOf()

Real Player::getProductionCostChangeBasedOnKindOf ( KindOfMaskType kindOf) const

Returns production cost change based on typeof (Used for upgrades)

getProductionCostChangeBasedOnKindOf gets the cost percentage change based off of Kindof Mask

Definition at line 3876 of file Player.cpp.

◆ getProductionCostChangePercent()

Real Player::getProductionCostChangePercent ( AsciiString buildTemplateName) const

Return bonus or penalty for construction of this thing.

Definition at line 1966 of file Player.cpp.

◆ getProductionTimeChangePercent()

Real Player::getProductionTimeChangePercent ( AsciiString buildTemplateName) const

Return bonus or penalty for construction of this thing.

Definition at line 1978 of file Player.cpp.

◆ getProductionVeterancyLevel()

VeterancyLevel Player::getProductionVeterancyLevel ( AsciiString buildTemplateName) const

Return starting veterancy level of a newly built thing of this type

Definition at line 1990 of file Player.cpp.

◆ getRankLevel()

Int Player::getRankLevel ( ) const
inline

Definition at line 665 of file Player.h.

◆ getRelationship()

Relationship Player::getRelationship ( const Team * that) const

get the relationship between this->that.

Definition at line 574 of file Player.cpp.

◆ getResourceGatheringManager()

ResourceGatheringManager * Player::getResourceGatheringManager ( )
inline

Definition at line 247 of file Player.h.

◆ getScienceAvailabilityTypeFromString()

ScienceAvailabilityType Player::getScienceAvailabilityTypeFromString ( const AsciiString & name)

Definition at line 2829 of file Player.cpp.

◆ getSciencePurchasePoints()

Int Player::getSciencePurchasePoints ( ) const
inline

Definition at line 664 of file Player.h.

◆ getScoreKeeper()

ScoreKeeper * Player::getScoreKeeper ( void )
inline

Grab the scorekeeper so we can score up in here!

Definition at line 605 of file Player.h.

◆ getSide()

AsciiString Player::getSide ( ) const
inline

Definition at line 226 of file Player.h.

◆ getSkillPoints()

Int Player::getSkillPoints ( ) const
inline

Definition at line 663 of file Player.h.

◆ getSkillPointsLevelDown()

Int Player::getSkillPointsLevelDown ( ) const
inline

Definition at line 667 of file Player.h.

◆ getSkillPointsLevelUp()

Int Player::getSkillPointsLevelUp ( ) const
inline

Definition at line 666 of file Player.h.

◆ getSkillPointsModifier()

Real Player::getSkillPointsModifier ( void ) const
inline

Definition at line 682 of file Player.h.

◆ getSquadNumberForObject()

Int Player::getSquadNumberForObject ( const Object * objToFind) const

return the hotkey squad that a unit is in, or NO_HOTKEY_SQUAD if it isn't in one

Definition at line 3776 of file Player.cpp.

◆ getSupplyBoxValue()

UnsignedInt Player::getSupplyBoxValue ( )

Many things can affect the alue of a crate, but at heart it is a GlobalData ratio.

Todo
This would be the hookup for difficulty level modifiers and special economy buildings

Definition at line 1959 of file Player.cpp.

◆ getTunnelSystem()

TunnelTracker * Player::getTunnelSystem ( )
inline

Definition at line 248 of file Player.h.

◆ getUnitsShouldHunt()

Bool Player::getUnitsShouldHunt ( ) const
inline

Definition at line 539 of file Player.h.

◆ grantScience()

Bool Player::grantScience ( ScienceType science)

grant the science, ignore prereqs & charge no points, but still restrict you to purchasable sciences (ie, intrinsic and rank sciences are not allowed) return true if successful.

Definition at line 2624 of file Player.cpp.

◆ guardSupplyCenter()

void Player::guardSupplyCenter ( Team * team,
Int minSupplies )

Have the team guard a supply center.

Guard supply center

Definition at line 1640 of file Player.cpp.

◆ hasAnyBuildFacility()

Bool Player::hasAnyBuildFacility ( void ) const

a convenience routine to quickly check if any buildfacilities are owned.

Definition at line 1919 of file Player.cpp.

◆ hasAnyBuildings() [1/2]

Bool Player::hasAnyBuildings ( KindOfMaskType kindOf) const

a convenience routine to quickly check if any buildings with a specific KindOfType flag are owned.

Definition at line 1880 of file Player.cpp.

◆ hasAnyBuildings() [2/2]

Bool Player::hasAnyBuildings ( void ) const

a convenience routine to quickly check if any buildings are owned.

Definition at line 1867 of file Player.cpp.

◆ hasAnyObjects()

Bool Player::hasAnyObjects ( void ) const

a convenience routine to quickly check if any objects are owned.

Definition at line 1906 of file Player.cpp.

◆ hasAnyShortcutSpecialPower()

Bool Player::hasAnyShortcutSpecialPower ( )

Definition at line 1527 of file Player.cpp.

◆ hasAnyUnits()

Bool Player::hasAnyUnits ( void ) const

a convenience routine to quickly check if any units are owned.

Definition at line 1893 of file Player.cpp.

◆ hasPrereqsForScience()

Bool Player::hasPrereqsForScience ( ScienceType t) const

return t iff the player has all sciences that are prereqs for knowing the given science

Definition at line 2462 of file Player.cpp.

◆ hasRadar()

Bool Player::hasRadar ( ) const

A positive number of radar producers, plus my radar is not disabled.

Definition at line 3239 of file Player.cpp.

◆ hasScience()

Bool Player::hasScience ( ScienceType t) const

return t if the player has the given science, either intrinsically, via specialization, or via capture.

Definition at line 2761 of file Player.cpp.

◆ hasUpgradeComplete() [1/2]

Bool Player::hasUpgradeComplete ( const UpgradeTemplate * upgradeTemplate)

does player have totally done and produced upgrade

Does the player have this completed upgrade

Definition at line 3009 of file Player.cpp.

◆ hasUpgradeComplete() [2/2]

Bool Player::hasUpgradeComplete ( UpgradeMaskType testMask)

does player have totally done and produced upgrade

Does the player have this completed upgrade. This form is exposed so Objects can do quick lookups.

Definition at line 3020 of file Player.cpp.

◆ hasUpgradeInProduction()

Bool Player::hasUpgradeInProduction ( const UpgradeTemplate * upgradeTemplate)

does player have this upgrade in progress right now

Does the player have this upgrade In Production

Definition at line 3028 of file Player.cpp.

◆ healAllObjects()

void Player::healAllObjects ( )

This player will heal everything owned by it

Definition at line 1788 of file Player.cpp.

◆ init()

void Player::init ( const PlayerTemplate * pt)

Definition at line 360 of file Player.cpp.

◆ initFromDict()

void Player::initFromDict ( const Dict * d)
Todo
Ack! the todo in PlayerList::reset() mentioning the need for a Player::reset() really needs to get done.

Definition at line 808 of file Player.cpp.

◆ isCapableOfPurchasingScience()

Bool Player::isCapableOfPurchasingScience ( ScienceType science) const

return true attemptToPurchaseScience() would succeed for this science.

Definition at line 2636 of file Player.cpp.

◆ isLocalPlayer()

Bool Player::isLocalPlayer ( ) const

Is this player the local player?

Definition at line 1941 of file Player.cpp.

◆ isLogicalRetaliationModeEnabled()

Bool Player::isLogicalRetaliationModeEnabled ( ) const
inline

Definition at line 647 of file Player.h.

◆ isPlayableSide()

Bool Player::isPlayableSide ( void ) const

Definition at line 3961 of file Player.cpp.

◆ isPlayerActive()

Bool Player::isPlayerActive ( void ) const

Definition at line 3955 of file Player.cpp.

◆ isPlayerDead()

Bool Player::isPlayerDead ( void ) const

Definition at line 3949 of file Player.cpp.

◆ isPlayerObserver()

Bool Player::isPlayerObserver ( void ) const

Definition at line 3943 of file Player.cpp.

◆ isScienceDisabled()

Bool Player::isScienceDisabled ( ScienceType t) const

Can't purchase this science because of script reasons.

Definition at line 2767 of file Player.cpp.

◆ isScienceHidden()

Bool Player::isScienceHidden ( ScienceType t) const

This science is effectively hidden due to script reasons.

Definition at line 2773 of file Player.cpp.

◆ isSkirmishAIPlayer()

Bool Player::isSkirmishAIPlayer ( void )

Is this player a skirmish ai player?

Is this player a skirmish ai player?

Definition at line 1188 of file Player.cpp.

◆ isSupplySourceAttacked()

Bool Player::isSupplySourceAttacked ( void )

Is a supply source attacked?

Is a supply source attacked?

Definition at line 1619 of file Player.cpp.

◆ isSupplySourceSafe()

Bool Player::isSupplySourceSafe ( Int minSupplies)

Is the nearest supply source safe?

Is the nearest supply source safe?

Definition at line 1608 of file Player.cpp.

◆ iterateObjects()

void Player::iterateObjects ( ObjectIterateFunc func,
void * userData ) const

Iterate all objects that this player has

Definition at line 1798 of file Player.cpp.

◆ killPlayer()

void Player::killPlayer ( void )

Destroy all of the teams for this player, causing him to DIE.

Definition at line 2055 of file Player.cpp.

◆ loadPostProcess()

void Player::loadPostProcess ( void )
protectedvirtual

Load post process

Implements Snapshot.

Definition at line 4553 of file Player.cpp.

◆ newMap()

void Player::newMap ( )

player after map loaded opportunity

Definition at line 761 of file Player.cpp.

◆ okToPlayRadarEdgeSound()

Bool Player::okToPlayRadarEdgeSound ( void )

just like it "sounds"

Definition at line 3150 of file Player.cpp.

◆ onPowerBrownOutChange()

void Player::onPowerBrownOutChange ( Bool brownOut)

one of my command centers just fired a special power, let us reset timers for all command centers.

Definition at line 3264 of file Player.cpp.

◆ onStructureConstructionComplete()

void Player::onStructureConstructionComplete ( Object * builder,
Object * structure,
Bool isRebuild )

a structure that was under construction has become completed

Definition at line 1668 of file Player.cpp.

◆ onStructureCreated()

void Player::onStructureCreated ( Object * builder,
Object * structure )

a structuer was just created, but is under construction

Definition at line 1660 of file Player.cpp.

◆ onStructureUndone()

void Player::onStructureUndone ( Object * structure)

a structure that was created has been pre-emptively removed and shouldn't be counted in the score.

Definition at line 1755 of file Player.cpp.

◆ onUnitCreated()

void Player::onUnitCreated ( Object * factory,
Object * unit )

A unit was just created and is ready to control.

A unit was just created and is ready to control

Definition at line 1590 of file Player.cpp.

◆ onUpgradeCompleted()

void Player::onUpgradeCompleted ( const UpgradeTemplate * upgradeTemplate)

An upgrade just finished, do things like tell all objects to recheck UpgradeModules.

An upgrade just finished, do things like tell all objects to recheck UpgradeModules

Definition at line 3086 of file Player.cpp.

◆ onUpgradeRemoved()

void Player::onUpgradeRemoved ( )
inline

An upgrade just got removed, this doesn't do anything now.

Power just changed at all. Didn't make two functions so you can't forget to undo something you didin one of them.

Todo
Can't do edge trigger until after demo; make things check for power on creation

Definition at line 326 of file Player.h.

◆ preTeamDestroy()

void Player::preTeamDestroy ( const Team * team)

A team is about to be destroyed.

A team is about to be destroyed

Definition at line 1650 of file Player.cpp.

◆ processAddTeamGameMessage()

void Player::processAddTeamGameMessage ( Int hotkeyNum,
GameMessage * msg )

Select a hotkey team based on this GameMessage

Definition at line 3716 of file Player.cpp.

◆ processCreateTeamGameMessage()

void Player::processCreateTeamGameMessage ( Int hotkeyNum,
GameMessage * msg )

time to create a hotkey team based on this GameMessage

Create a hotkey team based on this GameMessage

Definition at line 3661 of file Player.cpp.

◆ processSelectTeamGameMessage()

void Player::processSelectTeamGameMessage ( Int hotkeyNum,
GameMessage * msg )

time to select a hotkey team based on this GameMessage

Select a hotkey team based on this GameMessage

Definition at line 3686 of file Player.cpp.

◆ recruitSpecificTeam()

void Player::recruitSpecificTeam ( TeamPrototype * teamProto,
Real recruitRadius )

Recruits an instance of a specific team. Gets passed to aiPlayer.

Definition at line 2408 of file Player.cpp.

◆ removeBattlePlanBonusesForObject()

void Player::removeBattlePlanBonusesForObject ( Object * obj) const

Definition at line 3605 of file Player.cpp.

◆ removeKindOfProductionCostChange()

void Player::removeKindOfProductionCostChange ( KindOfMaskType kindOf,
Real percent )

Decrement the ref counter on the typeof production list node.

addTypeOfProductionCostChange adds a production change to the typeof list

Definition at line 3850 of file Player.cpp.

◆ removeObjectFromHotkeySquad()

void Player::removeObjectFromHotkeySquad ( Object * objToRemove)

Remove an object from any hotkey squads its on. (Should never be more than one, but do them all for good measure.

Definition at line 3791 of file Player.cpp.

◆ removePlayerRelationship()

Bool Player::removePlayerRelationship ( const Player * that)

Definition at line 617 of file Player.cpp.

◆ removePowerBonus()

void Player::removePowerBonus ( Object * obj)
inline

Definition at line 245 of file Player.h.

◆ removeRadar()

void Player::removeRadar ( Bool disableProof)

One less thing produces radar.

The parameter object has is taking its radar away from the player

Definition at line 3186 of file Player.cpp.

◆ removeTeamFromList()

void Player::removeTeamFromList ( TeamPrototype * team)

Definition at line 1774 of file Player.cpp.

◆ removeTeamRelationship()

Bool Player::removeTeamRelationship ( const Team * that)

Definition at line 650 of file Player.cpp.

◆ removeUpgrade()

void Player::removeUpgrade ( const UpgradeTemplate * upgradeTemplate)

remove thsi upgrade from us

Remove upgrade from a player

Definition at line 3118 of file Player.cpp.

◆ repairStructure()

void Player::repairStructure ( ObjectID structureID)
virtual

Have the ai check for bridges.

Repair bridge or structure.

Definition at line 1579 of file Player.cpp.

◆ resetOrStartSpecialPowerReadyFrame()

void Player::resetOrStartSpecialPowerReadyFrame ( const SpecialPowerTemplate * temp)

my new command center wants to init his timers to the status quo

Definition at line 3293 of file Player.cpp.

◆ resetRank()

void Player::resetRank ( )

reset rank to 1.

Definition at line 2669 of file Player.cpp.

◆ resetSciences()

void Player::resetSciences ( )

reset the sciences to just the intrinsic ones from the playertemplate, if any.

Definition at line 2510 of file Player.cpp.

◆ sellEverythingUnderTheSun()

void Player::sellEverythingUnderTheSun ( void )

Sell everything this player owns.

Definition at line 2320 of file Player.cpp.

◆ setAttackedBy()

void Player::setAttackedBy ( Int playerNdx)

setAttackedBy

Definition at line 3896 of file Player.cpp.

◆ setBuildList()

void Player::setBuildList ( BuildListInfo * pBuildList)

sets the build list.

Definition at line 673 of file Player.cpp.

◆ setCanBuildBase()

void Player::setCanBuildBase ( Bool canProduce)
inline

Definition at line 583 of file Player.h.

◆ setCanBuildUnits()

void Player::setCanBuildUnits ( Bool canProduce)
inline

Definition at line 579 of file Player.h.

◆ setCashBounty()

void Player::setCashBounty ( Real percentage)
inline

Definition at line 639 of file Player.h.

◆ setCurrentlySelectedAIGroup()

void Player::setCurrentlySelectedAIGroup ( AIGroup * group)

Select a hotkey team based on this GameMessage

Definition at line 3750 of file Player.cpp.

◆ setDefaultTeam()

void Player::setDefaultTeam ( void )

Definition at line 793 of file Player.cpp.

◆ setGeneralName()

void Player::setGeneralName ( UnicodeString name)
inline

Definition at line 669 of file Player.h.

◆ setListInScoreScreen()

void Player::setListInScoreScreen ( Bool listInScoreScreen)

this player should be listed in the score screen.

Definition at line 1947 of file Player.cpp.

◆ setLogicalRetaliationModeEnabled()

void Player::setLogicalRetaliationModeEnabled ( Bool set)
inline

Definition at line 648 of file Player.h.

◆ setObjectsEnabled()

void Player::setObjectsEnabled ( AsciiString templateTypeToAffect,
Bool enable )

Enabled/Disable all objects of type templateTypeToAffect.

Definition at line 2106 of file Player.cpp.

◆ setPlayerRelationship()

void Player::setPlayerRelationship ( const Player * that,
Relationship r )

set the relationship between this->that. (note that this doesn't affect the that->this relationship.)

Definition at line 607 of file Player.cpp.

◆ setPlayerType()

void Player::setPlayerType ( PlayerType t,
Bool skirmish )

Definition at line 768 of file Player.cpp.

◆ setRankLevel()

Bool Player::setRankLevel ( Int level)

returns TRUE if rank level really changed.

Definition at line 2686 of file Player.cpp.

◆ setScienceAvailability()

void Player::setScienceAvailability ( ScienceType science,
ScienceAvailabilityType type )

Definition at line 2779 of file Player.cpp.

◆ setSkillPointsModifier()

void Player::setSkillPointsModifier ( Real expMod)
inline

Definition at line 681 of file Player.h.

◆ setTeamDelaySeconds()

void Player::setTeamDelaySeconds ( Int delay)

Set delay between team production.

Set delay between team production

Definition at line 1630 of file Player.cpp.

◆ setTeamRelationship()

void Player::setTeamRelationship ( const Team * that,
Relationship r )

Definition at line 640 of file Player.cpp.

◆ setUnitsShouldHunt()

void Player::setUnitsShouldHunt ( Bool unitsShouldHunt,
CommandSourceType source )

Set that all units should begin hunting.

Definition at line 2011 of file Player.cpp.

◆ setUnitsShouldIdleOrResume()

void Player::setUnitsShouldIdleOrResume ( Bool idle)

Definition at line 2266 of file Player.cpp.

◆ setUnitsVisionSpied()

void Player::setUnitsVisionSpied ( Bool setting,
KindOfMaskType whichUnits,
PlayerIndex byWhom )

All of our units are new spied upon; they sight for the given enemy.

Definition at line 3932 of file Player.cpp.

◆ transferAssetsFromThat()

void Player::transferAssetsFromThat ( Player * that)

Transfer all assets from player that to this.

Definition at line 2132 of file Player.cpp.

◆ ungarrisonAllUnits()

void Player::ungarrisonAllUnits ( CommandSourceType source)

Definition at line 2232 of file Player.cpp.

◆ update()

void Player::update ( )

player update opportunity

Definition at line 711 of file Player.cpp.

◆ updateTeamStates()

void Player::updateTeamStates ( void )

a convenience routine to quickly update the state flags on all teams.

Definition at line 1931 of file Player.cpp.

◆ xfer()

void Player::xfer ( Xfer * xfer)
protectedvirtual

Xfer Method Version Info: 1: Initial version 2: Player can now have a modifier on his skill points (multiplicative) 3: Player can be excluded from the score screen via script. 4: Player stores a list of specialpowerreadyframe timers, used by specialpowermodules abroad 5: ??? (Profit) 6: Store m_unitsShouldHunt, set to true after the script "Tell player to hunt" is called. 7: added Preorder flag 8: Save m_disabledSciences & m_hiddenSciences. jba.

Implements Snapshot.

Definition at line 4007 of file Player.cpp.


The documentation for this class was generated from the following files: