Elements.pyECSS.Component.BasicTransformDecorator¶
- class Elements.pyECSS.Component.BasicTransformDecorator(comp, name=None, type=None, id=None)[source]¶
- An example of a concrete Component Decorator that wraps the component (BasicTransform)
and adds extra layered functionality
- Parameters
ComponentDecorator ([type]) – [description]
- __init__(comp, name=None, type=None, id=None)¶
Initializes a Component object with optional name, type, and id parameters.
Args: - name (str, optional): The name of the component. Defaults to None. - type (str, optional): The type of the component. Defaults to None. - id (str, optional): The ID of the component. Defaults to None.
If name is None, then the component’s name is set to the name of its class. If type is None, the type is set to the name of the class. If id is None, a unique ID is generated using the uuid.uuid1() method.
The _parent, _children, _worldManager, and _eventManager attributes are set to None by default.
Returns: - None
Methods
__init__(comp[, name, type, id])Initializes a Component object with optional name, type, and id parameters.
accept(system[, event])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.
getClassName()Get the name of this Component class.
getNumberOfChildren()Get the number of child Component objects for this Component.
init()example of a decorator
print()prints out name, type, id, parent of this Component
remove(object)Removes a Component object to the children of this Component.
update(**kwargs)method to be subclassed for debuging purposes only, in case we need some behavioral or logic computation within the Component.
Attributes
componenteventManagerGet the ECSSManager of the component.
idGet the ID of the component.
nameGet the name of the component.
parentGet the parent of the component.
typeGet the type of the component.
worldManagerGet Component’s ECSSManager