An Entity class for some light-weight ECS behavior in Flixel

Constructor

new (?options:EntityOptions)

Creates a new Entity with given options

 *  @param options	EntityOptions - {
 *  	?x:Float						x position,
 *  	?y:Float						y position,
 *  	?name:String					Entity name,
 *  	?components:Array<Component>	an array of components to be added to this Entity
 *  }

Methods

add_component (component:Component):Void

Add a component to this Entity

 *  @param component	Component to be added to this entity

add_tag (tag:String):Void

Add tag to this Entity

 *  @param tag	tag name

get_component (name:String):Null<Component>

Get component with name

 *  @param name	component name
 *  @return Null<Component>

inlineget_name ():String

returns the name of this Entity

 *  @return	String

inlinehas_tag (tag:String):Bool

Checks whether or not this Entity has a tag

 *  @param tag	tag name
 *  @return		Bool

remove_component (name:String):Void

Remove a component from this Entity

 *  @param name	the component's name