Packagecom.pblabs.engine.core
Classpublic class NameManager
InheritanceNameManager Inheritance Object

The name manager stores references to PBObjects that have been given names. These PBObjects can be looked up by name.



Public Properties
 PropertyDefined By
  objectList : Dictionary
[read-only] The list of registered PBObjects.
NameManager
Public Methods
 MethodDefined By
  
add(object:IPBObject):void
Registers an entity under a specific name.
NameManager
  
lookup(name:String):*
Looks up a PBObject with the specified name.
NameManager
  
lookupComponentByName(name:String, componentName:String):IEntityComponent
Looks up a component on an entity that has been registered.
NameManager
  
lookupComponentByType(name:String, componentType:Class):IEntityComponent
Looks up a component on an entity that has been registered.
NameManager
  
lookupComponentsByType(name:String, componentType:Class):Array
Looks up components on an entity that has been registered.
NameManager
  
remove(object:IPBObject):void
Removes an object from the manager.
NameManager
  
validateName(name:String):String
Turns a potentially used name and returns a related unused name.
NameManager
Property Detail
objectListproperty
objectList:Dictionary  [read-only]

The list of registered PBObjects.


Implementation
    public function get objectList():Dictionary
Method Detail
add()method
public function add(object:IPBObject):void

Registers an entity under a specific name. If the name is in use, lookups will return the last entity added under the name.

Parameters

object:IPBObject — The entity to add.

lookup()method 
public function lookup(name:String):*

Looks up a PBObject with the specified name.

Parameters

name:String — The name of the object to look up.

Returns
* — The object with the specified name, or null if it wasn't found.
lookupComponentByName()method 
public function lookupComponentByName(name:String, componentName:String):IEntityComponent

Looks up a component on an entity that has been registered. The same conditions apply as with the lookupComponentByName method on IEntity.

Parameters

name:String — name of the entity on which the component exists.
 
componentName:String — The name of the component to lookup.

Returns
IEntityComponent

See also

lookupComponentByType()method 
public function lookupComponentByType(name:String, componentType:Class):IEntityComponent

Looks up a component on an entity that has been registered. The same conditions apply as with the lookupComponentByType method on IEntity.

Parameters

name:String — name of the entity on which the component exists.
 
componentType:Class — The type of the component to lookup.

Returns
IEntityComponent

See also

lookupComponentsByType()method 
public function lookupComponentsByType(name:String, componentType:Class):Array

Looks up components on an entity that has been registered. The same conditions apply as with the lookupComponentsByType method on IEntity.

Parameters

name:String — name of the entity on which the component exists.
 
componentType:Class — The type of the components to lookup.

Returns
Array

See also

remove()method 
public function remove(object:IPBObject):void

Removes an object from the manager.

Parameters

object:IPBObject — The IPBObject to remove.

validateName()method 
public function validateName(name:String):String

Turns a potentially used name and returns a related unused name. The given name will have a number appended, with the number continually incremented until an unused name is found.

Parameters

name:String — The name to validate.

Returns
String — The validated name. This is guaranteed to not be in use.