|
ECPChildren | getChildren () |
| Children. More...
|
|
MutableID | getIDGenerator () |
| ID Generator. More...
|
|
Instance | instance (BehaviorElement element) |
| Get instance in element from owner element class. More...
|
|
ECBehaviorComposed | new (BehaviorElementClass eclass) |
| Create behavior element class. More...
|
|
ECBehaviorComposed | new (BehaviorElementClass eclass, ElementClassList elementClassList, MutableID idGenerator) |
|
ECBehaviorComposed | new (BehaviorElementClass eclass, ElementClassList elementClassList, MutableID idGenerator, String id) |
|
ECBehaviorComposed | new (BehaviorElementClass eclass, ElementClassList elementClassList, MutableID idGenerator, String id, String subID) |
|
ECBehaviorComposed | new (BehaviorElementClass eclass, ElementClassList elementClassList, MutableID idGenerator, String id, String subID, String prefix) |
|
ECBehaviorComposed | new (BehaviorElementClass eclass, String id) |
| Create default composeable behavior. More...
|
|
ECBehaviorComposed | new (BehaviorElementClass eclass, String id, String subID) |
|
ECBehaviorComposed | new (BehaviorElementClass eclass, String id, String subID, String prefix) |
|
void | setIDGenerator (MutableID idGenerator) |
| Set ID Generator. More...
|
|
void | assignInstanceIndex (int instanceIndex) |
| Assign instance index. More...
|
|
void | dispose () |
| Dispose of behavior. More...
|
|
String | getBehaviorID () |
| Unique identifier of behavior. More...
|
|
String | getID () |
| Identifier. More...
|
|
int | getInstanceIndex () |
| Instance index. More...
|
|
void | loadSupportedData (String identifier, PersistencyEnvironment env, FileReader reader, ECBehaviorInstance instance) |
| Load instance data of another behavior. More...
|
|
bool | supportsBehaviorID (String identifier) |
| Behavior supports loading instance data of another behavior. More...
|
|
ECBehaviorInstance | createInstance (BehaviorElement element) |
| Create Behavior instance. More...
|
|
Behavior for element allowing to create and add child elements.
This behavior is useful to create element classes which automatically create and attach child elements without using the world editor.
This behavior defines an element class property "composed.children". This is a list type property containing one map entry for each child element to create and attach. Children are created in the order they are defined. The map entry requires at least a string value with name "class" indicating the element class to use. Optionally a list value with name "properties" can be used containing stub element properties to use for creating the element. Values in this list are string values where the name is the property key and the string value is the property value.
Example "composed.children" element class property in XML attaching a backpack element using ECBehaviorAttachable which is attached to an attach slot defined in the owner class:
<list name='composed.children'>
<map>
<string key='class'>Backpack</string>
<list key='properties'>
<string key='attachToParent.attachSlot'>backpack</string>
</map>
</map>
</list>
Depending on the needs ECBehaviorAttachments should be added to this element class.
Element classes to compose with this element class should contain behaviors for attaching. Add ECBehaviorAttachToParent and optionally ECBehaviorAttachable if child element has to be attached to ECBehaviorAttachSlot. To configure the behaviors in the child elements use "properties" in "composed.children" entries.