Packageverlocity.ents
Classpublic class Entity
InheritanceEntity Inheritance Object
Subclasses BeatSpawner, DynamicEntity, SoundEmitter



Public Properties
 PropertyDefined 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
Public Methods
 MethodDefined 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
  
Removes all health of the entity.
Entity
  
Reset():void
Resets the entity to its original values.
Entity
  
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
Protected Methods
 MethodDefined By
  
OnDeath():void
Called when the entity's health is now 0.
Entity
  
Called when the entity's health has been changed.
Entity
  
Called when the entity took damage via TakeDamage function.
Entity
Property Detail
_displayproperty
_display:Boolean  [read-only]

Returns if this entity base contains display functionality (will not Init until spawned).


Implementation
    public function get _display():Boolean
_dynamicproperty 
_dynamic:Boolean  [read-only]

Returns if the entity is dynamic.


Implementation
    public function get _dynamic():Boolean
_idproperty 
_id:int

Returns the registration ID of the entity.


Implementation
    public function get _id():int
    public function set _id(value:int):void
baseClassproperty 
baseClass:Object  [read-only]

Returns the entity base class.


Implementation
    public function get baseClass():Object
defaultHealthproperty 
defaultHealth:int  [read-only]

A getter that returns the default health the entity has.


Implementation
    public function get defaultHealth():int
healthproperty 
health:int  [read-only]

A getter that returns the current health value of the entity.


Implementation
    public function get health():int
maxHealthproperty 
maxHealth:int

A getter that returns the maximum health this entity can have.


Implementation
    public function get maxHealth():int
    public function set maxHealth(value:int):void
Method Detail
_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.

Returns
Object
GetOwner()method 
public function GetOwner():Object

Returns the current owner of the entity.

Returns
Object
GetType()method 
public function GetType():String

Returns the current string type of the entity.

Returns
String
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

Returns
Boolean
IsDead()method 
public function IsDead():Boolean

Returns if the entity is dead. Used to automatically clean remove the entity.

Returns
Boolean
IsHealthZero()method 
public function IsHealthZero():Boolean

Returns if the health is zero.

Returns
Boolean
IsProtected()method 
public function IsProtected():Boolean

Returns if the entity is protected. See SetProtected for more details.

Returns
Boolean
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

Returns
Boolean
IsUpdating()method 
public function IsUpdating():Boolean

Returns if the entity is updating.

Returns
Boolean
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!