Packagecom.pblabs.engine.core
Interfacepublic interface IPBObject
Implementors PBObject

Interface for a named object that can exist in a group or set.

See also

PBGroup, IEntity


Public Properties
 PropertyDefined By
  alias : String
[read-only] Since the PBE level format references template definitions by name, and that same name is used to name the entities created by the format, it is useful to be able to look things up by a common name.
IPBObject
  name : String
[read-only] The name of the PBObject.
IPBObject
  owningGroup : PBGroup
The PBGroup which owns this PBObject.
IPBObject
Public Methods
 MethodDefined By
  
destroy():void
Destroys the PBObject by removing all components and unregistering it from the name manager.
IPBObject
  
initialize(name:String = null, alias:String = null):void
initializes the PBObject, optionally assigning it a name.
IPBObject
Property Detail
aliasproperty
alias:String  [read-only]

Since the PBE level format references template definitions by name, and that same name is used to name the entities created by the format, it is useful to be able to look things up by a common name. So you might have Level1Background, Level2Background, Level3Background etc. but give them all the alias LevelBackground so you can look up the current level's background easily.

This is set by the second parameter to #initialize()


Implementation
    public function get alias():String
nameproperty 
name:String  [read-only]

The name of the PBObject. This is set by passing a name to the initialize method after the PBObject is first created.


Implementation
    public function get name():String

See also

owningGroupproperty 
owningGroup:PBGroup

The PBGroup which owns this PBObject. If the owning group is destroy()ed, the PBObject is destroy()ed as well. This is useful for managing object lifespans - for instance, all the PBObjects in a level might belong to one common group for easy cleanup.


Implementation
    public function get owningGroup():PBGroup
    public function set owningGroup(value:PBGroup):void
Method Detail
destroy()method
public function destroy():void

Destroys the PBObject by removing all components and unregistering it from the name manager.

PBObjects are automatically removed from any groups/sets that they are members of when they are destroy()'ed.

Currently this will not invalidate any other references to the PBObject so the PBObject will only be cleaned up by the garbage collector if those are set to null manually.

initialize()method 
public function initialize(name:String = null, alias:String = null):void

initializes the PBObject, optionally assigning it a name. This should be called immediately after the PBObject is created.

Parameters

name:String (default = null) — The name to assign to the PBObject. If this is null or an empty string, the PBObject will not register itself with the name manager.
 
alias:String (default = null) — An alternate name under which this PBObject can be looked up. Useful when you need to distinguish between multiple things but refer to the active one by a consistent name.

See also