Difference between revisions of "Script/Building"

From SF3
Jump to: navigation, search
Line 17: Line 17:
 
| style = 'color: #505050; line-height: 0.5;' |''get building description name''
 
| style = 'color: #505050; line-height: 0.5;' |''get building description name''
 
|-
 
|-
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|string]]  
+
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../LogicEnums#EBuildingType|EBuildingType]]  
 
| style='color: black; width: 90%; line-height: 0.8;' | '''GetBuildingType''' () const
 
| style='color: black; width: 90%; line-height: 0.8;' | '''GetBuildingType''' () const
 
|-
 
|-
 
|
 
|
| style = 'color: #505050; line-height: 0.5;' |''get building type name''
+
| style = 'color: #505050; line-height: 0.5;' |''get building type''
 
|-
 
|-
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|string]]  
+
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../LogicEnums#EBuildingStage|EBuildingStage]]  
 
| style='color: black; width: 90%; line-height: 0.8;' | '''GetStage''' () const
 
| style='color: black; width: 90%; line-height: 0.8;' | '''GetStage''' () const
 
|-
 
|-
 
|
 
|
| style = 'color: #505050; line-height: 0.5;' |''get current building stage name''
+
| style = 'color: #505050; line-height: 0.5;' |''get current building stage''
 
|-
 
|-
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|int]]  
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|int]]  
Line 60: Line 60:
 
|-
 
|-
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]  
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]  
| style='color: black; width: 90%; line-height: 0.8;' | '''Damage''' (const [[../BasicDataTypes|string]]&in ''_sDamageTypeName'', const [[../BasicDataTypes|uint]] ''_uAmount'')
+
| style='color: black; width: 90%; line-height: 0.8;' | '''Damage''' (const [[../LogicEnums#EDamageType|EDamageType]] ''_DamageType'', const [[../BasicDataTypes|uint]] ''_uAmount'')
 
|-
 
|-
 
|
 
|

Revision as of 10:43, 7 September 2016

class Building

Represents a reference to a building in the game world. An instance of this class acts like a weak pointer to an existing building in the game world and provides an interface to interact with it. Before interacting with the building, you should call Exists() in order to check if the building actually (still) exists. IMPORTANT: This class must NOT be stored as a class member. If you want to store the building for later reference, store the id obtained by GetId instead. You can then later retrieve the building from the LevelReference class by calling GetBuildingById.

Inherits from: Entity

Class Methods

string GetDescriptionName () const
get building description name
EBuildingType GetBuildingType () const
get building type
EBuildingStage GetStage () const
get current building stage
int GetCurrentHP () const
get current building health
int GetMaxHP () const
get maximum building health
void Charge (const int _iChargePoints)
modify charge value of a charge type building
bool IsActive () const
is the building currently active? (assignments can be given by the player)
void SetActive (const bool _bActive)
set whether the player can give assignments to the building
bool Damage (const EDamageType _DamageType, const uint _uAmount)
damage the building for _uAmount HP of the given damage type, returns true if destroyed
void Destroy ()
immediately destroy the building
Building& operator= (const Building&in)
bool operator== (const Building&in)
bool operator== (const Entity&in)
bool Exists () const
does the entity actually exist? (always check this before doing anything with the entity!)
uint GetId () const
get persistent entity id, use this to save the entity for later reference.
uint8 GetFaction () const
get owner faction
void SetFaction (const uint8 _Faction)
set owner faction
string GetEntityType () const
get entity type name
bool IsEnabled () const
whether the entity is currently enabled (i.e. is visible in the game world)
void Enable (const bool _bEnabled)
enabled or disable the entity
bool IsInteractive () const
can the entity be interacted with?
void SetInteractive (const bool _bInteractive)
set whether the entity can be interacted with
bool CanBeAttacked () const
can the entity be attacked?
void SetAttackable (const bool _bAttackable)
set whether the entity can be attacked
Entity opImplConv () const

class Building

Represents a reference to a building in the game world. An instance of this class acts like a weak pointer to an existing building in the game world and provides an interface to interact with it. Before interacting with the building, you should call Exists() in order to check if the building actually (still) exists. IMPORTANT: This class must NOT be stored as a class member. If you want to store the building for later reference, store the id obtained by GetId instead. You can then later retrieve the building from the LevelReference class by calling GetBuildingById.

Inherits from: Entity

Class Methods

string GetDescriptionName () const
get building description name
string GetBuildingType () const
get building type name
string GetStage () const
get current building stage name
int GetCurrentHP () const
get current building health
int GetMaxHP () const
get maximum building health
void Charge (const int _iChargePoints)
modify charge value of a charge type building
bool IsActive () const
is the building currently active? (assignments can be given by the player)
void SetActive (const bool _bActive)
set whether the player can give assignments to the building
bool Damage (const string&in _sDamageTypeName, const uint _uAmount)
damage the building for _uAmount HP of the given damage type, returns true if destroyed
void Destroy ()
immediately destroy the building
Building& operator= (const Building&in)
bool operator== (const Building&in)
bool operator== (const Entity&in)
bool Exists () const
does the entity actually exist? (always check this before doing anything with the entity!)
uint GetId () const
get persistent entity id, use this to save the entity for later reference.
uint8 GetFaction () const
get owner faction
void SetFaction (const uint8 _Faction)
set owner faction
string GetEntityType () const
get entity type name
bool IsEnabled () const
whether the entity is currently enabled (i.e. is visible in the game world)
void Enable (const bool _bEnabled)
enabled or disable the entity
bool IsInteractive () const
can the entity be interacted with?
void SetInteractive (const bool _bInteractive)
set whether the entity can be interacted with
bool CanBeAttacked () const
can the entity be attacked?
void SetAttackable (const bool _bAttackable)
set whether the entity can be attacked
Entity opImplConv () const