Package | verlocity.ents |
Class | public class Entity |
Inheritance | Entity Object |
Subclasses | BeatSpawner, DynamicEntity, SoundEmitter |
Property | Defined By | ||
---|---|---|---|
baseClass : Object [read-only]
Returns the entity base class. | Entity | ||
defaultHealth : int [read-only]
A getter that returns the default health the entity has. | Entity | ||
_display : Boolean [read-only]
Returns if this entity base contains display functionality (will not Init until spawned). | Entity | ||
_dynamic : Boolean [read-only]
Returns if the entity is dynamic. | Entity | ||
health : int [read-only]
A getter that returns the current health value of the entity. | Entity | ||
_id : int
Returns the registration ID of the entity. | Entity | ||
maxHealth : int
A getter that returns the maximum health this entity can have. | Entity |
Method | Defined By | ||
---|---|---|---|
_Dispose():void
Cleans the entity's data. | Entity | ||
_Update():void
Called each engine tick, do not override this. | Entity | ||
Construct():void
Called before the entity is spawned to setup the constants of the entity. | Entity | ||
DeInit():void
Called when the entity is deleted. | Entity | ||
EnableUpdate(bUpdate:Boolean = true):void
Sets if the entity will update each engine tick. | Entity | ||
GetClass():Object
Returns the class of the entity. | Entity | ||
GetOwner():Object
Returns the current owner of the entity. | Entity | ||
GetType():String
Returns the current string type of the entity. | Entity | ||
Init():void
Called when the entity is first registered/spawned. | Entity | ||
Is(cClass:Class):Boolean
Returns if the entity matches a class. | Entity | ||
IsDead():Boolean
Returns if the entity is dead. | Entity | ||
IsHealthZero():Boolean
Returns if the health is zero. | Entity | ||
IsProtected():Boolean
Returns if the entity is protected. | Entity | ||
IsT(sCheckType:String):Boolean
Returns if the entity is matches a type (lowercase only). | Entity | ||
IsUpdating():Boolean
Returns if the entity is updating. | Entity | ||
Remove():void
Marks the entity for removal. | Entity | ||
RemoveAllHealth():void
Removes all health of the entity. | Entity | ||
Reset():void
Resets the entity to its original values. | Entity | ||
ResetHealth():void
Resets the entity's health to the default health. | Entity | ||
SetDefaultHealth(setHealth:int = 100):void
Sets the default health of this entity. | Entity | ||
SetHealth(newHealth:int):void
Sets the health value of this entity. | Entity | ||
SetOwner(newOwner:Object):void
Sets the owner of the entity. | Entity | ||
SetProtected(bProtected:Boolean = true):void
Protects an entity from being removed by clean up
calls, such as CleanSlate. | Entity | ||
SetType(sSetType:String):void
Sets the string type of the entity. | Entity | ||
TakeDamage(iDamageAmount:int):void
Subtracts the current health. | Entity | ||
Update():void
Called each engine tick. | Entity |
Method | Defined By | ||
---|---|---|---|
OnDeath():void
Called when the entity's health is now 0. | Entity | ||
OnHealthChanged():void
Called when the entity's health has been changed. | Entity | ||
OnTakeDamage():void
Called when the entity took damage via TakeDamage function. | Entity |
_display | property |
_display:Boolean
[read-only] Returns if this entity base contains display functionality (will not Init until spawned).
public function get _display():Boolean
_dynamic | property |
_dynamic:Boolean
[read-only] Returns if the entity is dynamic.
public function get _dynamic():Boolean
_id | property |
_id:int
Returns the registration ID of the entity.
public function get _id():int
public function set _id(value:int):void
baseClass | property |
baseClass:Object
[read-only] Returns the entity base class.
public function get baseClass():Object
defaultHealth | property |
defaultHealth:int
[read-only] A getter that returns the default health the entity has.
public function get defaultHealth():int
health | property |
health:int
[read-only] A getter that returns the current health value of the entity.
public function get health():int
maxHealth | property |
maxHealth:int
A getter that returns the maximum health this entity can have.
public function get maxHealth():int
public function set maxHealth(value:int):void
_Dispose | () | method |
public function _Dispose():void
Cleans the entity's data. DO NOT CALL MANUALLY - THIS IS HANDLED BY verEnts!
_Update | () | method |
public function _Update():void
Called each engine tick, do not override this. DO NOT CALL MANUALLY - THIS IS HANDLED BY verEnts!
Construct | () | method |
public function Construct():void
Called before the entity is spawned to setup the constants of the entity. DO NOT CALL MANUALLY - THIS IS HANDLED BY verEnts!
DeInit | () | method |
public function DeInit():void
Called when the entity is deleted. DO NOT CALL MANUALLY - THIS IS HANDLED BY verEnts!
EnableUpdate | () | method |
public function EnableUpdate(bUpdate:Boolean = true):void
Sets if the entity will update each engine tick.
Parameters
bUpdate:Boolean (default = true ) — A boolean that determines if the entity should update.
|
GetClass | () | method |
public function GetClass():Object
Returns the class of the entity.
ReturnsObject |
GetOwner | () | method |
public function GetOwner():Object
Returns the current owner of the entity.
ReturnsObject |
GetType | () | method |
public function GetType():String
Returns the current string type of the entity.
ReturnsString |
Init | () | method |
public function Init():void
Called when the entity is first registered/spawned. Called each soft reset. DO NOT CALL MANUALLY - THIS IS HANDLED BY verEnts!
Is | () | method |
public function Is(cClass:Class):Boolean
Returns if the entity matches a class.
Parameters
cClass:Class |
Boolean |
IsDead | () | method |
public function IsDead():Boolean
Returns if the entity is dead. Used to automatically clean remove the entity.
ReturnsBoolean |
IsHealthZero | () | method |
public function IsHealthZero():Boolean
Returns if the health is zero.
ReturnsBoolean |
IsProtected | () | method |
public function IsProtected():Boolean
Returns if the entity is protected. See SetProtected for more details.
ReturnsBoolean |
IsT | () | method |
public function IsT(sCheckType:String):Boolean
Returns if the entity is matches a type (lowercase only). A little faster than ent.Is()
Parameters
sCheckType:String |
Boolean |
IsUpdating | () | method |
public function IsUpdating():Boolean
Returns if the entity is updating.
ReturnsBoolean |
OnDeath | () | method |
protected function OnDeath():void
Called when the entity's health is now 0.
OnHealthChanged | () | method |
protected function OnHealthChanged():void
Called when the entity's health has been changed.
OnTakeDamage | () | method |
protected function OnTakeDamage():void
Called when the entity took damage via TakeDamage function.
Remove | () | method |
public function Remove():void
Marks the entity for removal.
RemoveAllHealth | () | method |
public function RemoveAllHealth():void
Removes all health of the entity.
Reset | () | method |
public function Reset():void
Resets the entity to its original values.
ResetHealth | () | method |
public function ResetHealth():void
Resets the entity's health to the default health. Requires SetDefaultHealth to be called first!
SetDefaultHealth | () | method |
public function SetDefaultHealth(setHealth:int = 100):void
Sets the default health of this entity. Used to respawn the entity with the proper health. This can only be set once per instance!
Parameters
setHealth:int (default = 100 ) — The default health to set to (usually 100). Required to be over zero!
|
SetHealth | () | method |
public function SetHealth(newHealth:int):void
Sets the health value of this entity. If the health is zero, the entity will call the OnDeath function.
Parameters
newHealth:int |
SetOwner | () | method |
public function SetOwner(newOwner:Object):void
Sets the owner of the entity. Useful for bullets, weapons, inventory, etc.
Parameters
newOwner:Object — The object that owns the entity.
|
SetProtected | () | method |
public function SetProtected(bProtected:Boolean = true):void
Protects an entity from being removed by clean up calls, such as CleanSlate. To remove them, you need to set bRemoveProtected to true in clean up function calls.
Parameters
bProtected:Boolean (default = true ) — Mark this object as protected to prevent automatic clean up.
|
SetType | () | method |
public function SetType(sSetType:String):void
Sets the string type of the entity. Useful for flag checking. NOTE: All types will become lower case to prevent confusion.
Parameters
sSetType:String — The string type you wish to set.
|
TakeDamage | () | method |
public function TakeDamage(iDamageAmount:int):void
Subtracts the current health. Also calls OnTakeDamage function If the health is zero, the entity will call the OnDeath function.
Parameters
iDamageAmount:int — The amount of health to remove.
|
Update | () | method |
public function Update():void
Called each engine tick. Toggle with EnableUpdate( bEnabe ). DO NOT CALL MANUALLY - THIS IS HANDLED BY verEnts!