Drag[en]gine Script Module DragonScript  1.23
Dragengine.Scenery.ECBehaviorComposed Class Reference

Behavior for element allowing to create and add child elements. More...

Inheritance diagram for Dragengine.Scenery.ECBehaviorComposed:
Dragengine.Scenery.DefaultECBehavior Dragengine.Scenery.ECBehavior Dragengine.Scenery.BehaviorCompatiblePersistency

Classes

class  ChildElement
 Child element definition. More...
 
class  ECPChildren
 Children element class property. More...
 

Public Member Functions

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...
 
- Public Member Functions inherited from Dragengine.Scenery.DefaultECBehavior
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...
 
- Public Member Functions inherited from Dragengine.Scenery.ECBehavior
ECBehaviorInstance createInstance (BehaviorElement element)
 Create Behavior instance. More...
 

Static Public Member Functions

static ECBehaviorComposed getBehaviorIn (BehaviorElementClass eclass)
 Get behavior in element class or null if absent. More...
 

Public Attributes

ECPChildren pChildren
 
MutableID pIDGenerator
 

Additional Inherited Members

- Protected Member Functions inherited from Dragengine.Scenery.DefaultECBehavior
void setBehaviorID (String identifier)
 Set behavior identifier. More...
 
void useClassNameAsBehaviorID ()
 Set behavior identifier to "<class-name>:<identifier>". More...
 
void useFullyQualifiedClassNameAsBehaviorID ()
 Set behavior identifier to "<fully-qualified-class-name>:<identifier>". More...
 

Detailed Description

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.

Member Function Documentation

◆ getBehaviorIn()

static ECBehaviorComposed Dragengine.Scenery.ECBehaviorComposed.getBehaviorIn ( BehaviorElementClass  eclass)
static

Get behavior in element class or null if absent.

Use this method to check if a particular BehaviorElementClass contains a behavior of type ECBehaviorCollider.

◆ getChildren()

ECPChildren Dragengine.Scenery.ECBehaviorComposed.getChildren ( )

Children.

◆ getIDGenerator()

MutableID Dragengine.Scenery.ECBehaviorComposed.getIDGenerator ( )

ID Generator.

◆ instance()

Instance Dragengine.Scenery.ECBehaviorComposed.instance ( BehaviorElement  element)

Get instance in element from owner element class.

◆ new() [1/8]

ECBehaviorComposed Dragengine.Scenery.ECBehaviorComposed.new ( BehaviorElementClass  eclass)

Create behavior element class.

Reimplemented from Dragengine.Scenery.DefaultECBehavior.

◆ new() [2/8]

ECBehaviorComposed Dragengine.Scenery.ECBehaviorComposed.new ( BehaviorElementClass  eclass,
ElementClassList  elementClassList,
MutableID  idGenerator 
)

◆ new() [3/8]

ECBehaviorComposed Dragengine.Scenery.ECBehaviorComposed.new ( BehaviorElementClass  eclass,
ElementClassList  elementClassList,
MutableID  idGenerator,
String  id 
)

◆ new() [4/8]

ECBehaviorComposed Dragengine.Scenery.ECBehaviorComposed.new ( BehaviorElementClass  eclass,
ElementClassList  elementClassList,
MutableID  idGenerator,
String  id,
String  subID 
)

◆ new() [5/8]

ECBehaviorComposed Dragengine.Scenery.ECBehaviorComposed.new ( BehaviorElementClass  eclass,
ElementClassList  elementClassList,
MutableID  idGenerator,
String  id,
String  subID,
String  prefix 
)

◆ new() [6/8]

ECBehaviorComposed Dragengine.Scenery.ECBehaviorComposed.new ( BehaviorElementClass  eclass,
String  id 
)

Create default composeable behavior.

Reimplemented from Dragengine.Scenery.DefaultECBehavior.

◆ new() [7/8]

ECBehaviorComposed Dragengine.Scenery.ECBehaviorComposed.new ( BehaviorElementClass  eclass,
String  id,
String  subID 
)

◆ new() [8/8]

ECBehaviorComposed Dragengine.Scenery.ECBehaviorComposed.new ( BehaviorElementClass  eclass,
String  id,
String  subID,
String  prefix 
)

◆ setIDGenerator()

void Dragengine.Scenery.ECBehaviorComposed.setIDGenerator ( MutableID  idGenerator)

Set ID Generator.

Member Data Documentation

◆ pChildren

ECPChildren Dragengine.Scenery.ECBehaviorComposed.pChildren

◆ pIDGenerator

MutableID Dragengine.Scenery.ECBehaviorComposed.pIDGenerator

The documentation for this class was generated from the following file: