Elements.pyECSS.Entity.Entity

class Elements.pyECSS.Entity.Entity(name=None, type=None, id=None)[source]

The main EntityI concrete class of glGA ECS This is the typical equivalent of a Group node in traditional scenegraphs or GameObject in Unity Engine It can contain several other Entity objects as children. It is an actual data aggregator container of Components. All the actuall operations and logic is performed by Systems and not the Components or Entity itself.

__init__(name=None, type=None, id=None)None[source]

PEP 256 note this is how we declare the type of variables in Phython 3.6 and later. e.g. x: int=1 or x: List[int] = [1]

Methods

__init__([name, type, id])

PEP 256 note this is how we declare the type of variables in Phython 3.6 and later.

accept(system)

Accepts a class object to operate on the Component, based on the Visitor pattern.

add(object)

Add a Component object to the children of this Component.

getChild(index)

Get the child Component object at the given index.

getChildByType(type)

getClassName()

Get the name of this Component class.

getNumberOfChildren()

Get the number of child Component objects for this Component.

getParent()

init()

abstract method to be subclassed for extra initialisation

isEntity()

print()

Print out contents of Entity for Debug purposes only

remove(object)

Removes a Component object to the children of this Component.

transform()

Sample transform() only for subclassing here and debug purposes

update(**kwargs)

method to be subclassed for debuging purposes only, in case we need some behavioral or logic computation within the Component.

Attributes

eventManager

Get the ECSSManager of the component.

id

Get the ID of the component.

name

Get the name of the component.

parent

Get the parent of the component.

type

Get the type of the component.

worldManager

Get Component’s ECSSManager