| Package | com.pblabs.engine.entity |
| Interface | public interface IEntityComponent |
| Implementors | EntityComponent |
A full featured implementation of this interface is included (EntityComponent). It should be adequate for almost every situation, and therefore, custom components should derive from it rather than implementing this interface directly.
There are several reasons why PBE is set up this way:
See also
| Property | Defined By | ||
|---|---|---|---|
| isRegistered : Boolean [read-only]
Whether or not the component is currently registered with an entity. | IEntityComponent | ||
| name : String [read-only]
The name given to the component when it is added to an entity. | IEntityComponent | ||
| owner : IEntity
A reference to the entity that this component currently belongs to. | IEntityComponent | ||
| Method | Defined By | ||
|---|---|---|---|
Registers the component with an entity. | IEntityComponent | ||
reset():void
This is called by an entity on all of its components any time a component
is added or removed. | IEntityComponent | ||
unregister():void
Unregisters the component from an entity. | IEntityComponent | ||
| isRegistered | property |
isRegistered:Boolean [read-only] Whether or not the component is currently registered with an entity.
public function get isRegistered():Boolean| name | property |
name:String [read-only] The name given to the component when it is added to an entity. This value should be equivelent to the second parameter passed to the register method.
public function get name():StringSee also
| owner | property |
owner:IEntityA reference to the entity that this component currently belongs to. If the component has not been added to an entity, this will be null.
This value should be equivalent to the first parameter passed to the register method.
public function get owner():IEntity public function set owner(value:IEntity):voidSee also
| register | () | method |
public function register(owner:IEntity, name:String):voidRegisters the component with an entity. This should only ever be called by an IEntity from the addComponent method.
Parameters
owner:IEntity — The entity to register the component with.
| |
name:String — The name to assign to the component.
|
| reset | () | method |
public function reset():voidThis is called by an entity on all of its components any time a component is added or removed. In this method, any references to properties on the owner entity should be purged and re-looked up.
| unregister | () | method |
public function unregister():voidUnregisters the component from an entity. This should only ever be called by an entity class from the removeComponent method.