Script/ResourceDeposit

From SF3
Revision as of 09:01, 1 September 2016 by Dave (talk | contribs)

Jump to: navigation, search

class ResourceDeposit

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

Inherits from: Entity

Class Methods

string GetResourceType () const
get resource type name
uint GetCurrent () const
get current amount of resource units in the deposit
uint GetCapacity () const
get maximum amount of resources in the deposit
uint AddResources (const uint _uAmount)
add _uAmount resource units to the deposit (this will automatically be capped at the deposit's capacity).
uint RemoveResources (const uint _uAmount)
remove _uAmount resources units from the deposit (can not go below 0)
ResourceDeposit& operator= (const ResourceDeposit&in)
bool operator== (const ResourceDeposit&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 ResourceDeposit

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

Inherits from: Entity

Class Methods

string GetResourceType () const
get resource type name
uint GetCurrent () const
get current amount of resource units in the deposit
uint GetCapacity () const
get maximum amount of resources in the deposit
uint AddResources (const uint _uAmount)
add _uAmount resource units to the deposit (this will automatically be capped at the deposit's capacity).
uint RemoveResources (const uint _uAmount)
remove _uAmount resources units from the deposit (can not go below 0)
ResourceDeposit& operator= (const ResourceDeposit&in)
bool operator== (const ResourceDeposit&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