|
Drag[en]gine Script Module DragonScript 1.32.1
|
Behavior element element class. More...
Classes | |
| class | XmlBehaviorInfo |
| XML behavior information required for XML-XML subclassing. More... | |
Public Member Functions | |
| void | addAttachableBehaviorFactories () |
| Add attachable behavior factories supported by this element class. | |
| void | addAttachableBehaviorFactories (AttachableBehaviorFactoryList factories) |
| Add attachable behavior factories replacing duplicates if present. | |
| void | addAttachableBehaviorFactory (AttachableBehaviorFactory factory) |
| Add attachable behavior factory replacing duplicate if present. | |
| void | addBehavior (ECBehavior behavior) |
| Add behavior. | |
| void | addBehaviorFactories (BehaviorFactoryList factories) |
| Add behavior factories replacing duplicates if present. | |
| void | addDefaultAttachableBehaviorFactories () |
| Add all attachable behavior factories present in the DragonScript module. | |
| void | addDefaultBehaviorFactories () |
| Add all behavior factories present in the DragonScript module. | |
| void | addXmlBehaviorInfo (BehaviorFactory factory, String id, Dictionary parameters) |
| Add XML behavior information required for XML-XML subclassing. | |
| Array | collectBehaviors (Block ablock) |
| Collect behaviors with block into Array. | |
| void | createAndAddElement (StubElement stub, GameWorld gameWorld) |
| Create element from given stub and add it to game world. | |
| void | dispose () |
| Dispose of element class. | |
| ECBehavior | findBehavior (Block ablock) |
| Find behavior with block. | |
| void | forEachAttachableBehaviorFactory (Block ablock) |
| Visit attachable behavior factories. | |
| void | forEachBehavior (Block ablock) |
| Visit behaviors with block. | |
| void | forEachBehaviorDirect (Block ablock) |
| Visit behaviors with block. | |
| void | forEachBehaviorFactory (Block ablock) |
| Visit behavior factories. | |
| void | forEachPrepareStubBehavior (Block ablock) |
| Visit prepare stub behaviors with block. version 1.23. | |
| void | forEachPreventCreationBehavior (Block ablock) |
| Visit prevent creation behaviors with block. version 1.23. | |
| void | forEachXmlBehaviorInfo (Block ablock) |
| Visit XML behavior info with block with argument XmlBehaviorInfo. | |
| AttachableBehaviorFactory | getAttachableBehaviorFactoryWithId (String id) |
| Attachable behavior factory with identifier or null if absent. | |
| ECBehavior | getBehaviorAt (int index) |
| Behavior at index. | |
| BehaviorFactory | getBehaviorFactoryWithId (String id) |
| Behavior factory with identifier or null if absent. | |
| ECBehavior | getBehaviorWithId (String id) |
| Behavior with matching BehaviorCompatiblePersistency::getBehaviorID() or null. | |
| BehaviorElementClass | new () |
| Create element class using loaders from BaseGameApp. | |
| BehaviorElementClass | new (Loaders loaders) |
| Create element class. | |
| BehaviorElementClass | new (String className) |
| Create element class using loaders from BaseGameApp. | |
| BehaviorElementClass | new (String className, Loaders loaders) |
| Create element class. | |
| void | prepareStubs (StubElement stub, GameWorld gameWorld, bool loading) |
| Call prepareStub on all prepare stub behaviors. | |
| bool | preventCreation (StubElement stub, GameWorld gameWorld) |
| Call prepareStub on all prepare stub behaviors. | |
| void | removeAllAttachableBehaviorFactories () |
| Remove all attachable behavior factories. | |
| void | removeAllBehaviorFactories () |
| Remove all behavior factories. | |
Public Member Functions inherited from Dragengine.Scenery.ElementClass | |
| void | addProperty (ElementClassProperty property) |
| Add property. | |
| void | copyPropertyValues (ElementClass eclass) |
| Copy values of properties from another class to properties of this class. | |
| Element | createElement (StubElement stub) |
| Create element instance from stub. | |
| ElementClass | duplicateNamed (String classname) |
| Create duplicate of class with new name. | |
| bool | equals (Object obj) |
| Element class is equal to another object. | |
| void | failedLoading (String path, ResourceLoaderType resourceType) |
| Resource failed loading. | |
| void | finishedLoading (String path, ResourceLoaderType resourceType, Object resource) |
| Resource finished loading successfully. | |
| void | forEachProperty (Block ablock) |
| Visit properties with block with parameter ElementClass. | |
| String | getBasePath () |
| Base path for relative loading of resource properties. | |
| CodecPropertyString | getCodecPropertyString () |
| Property codec helper. | |
| bool | getIsXmlElementClass () |
| Element class is an XML element class. | |
| bool | getPersistable () |
| Element class is persistable to file writers. | |
| int | getPropertyCount () |
| Number of properties. | |
| ElementClassProperty | getPropertyNamed (String name) |
| Named property or null if absent. | |
| Array | getPropertyNames () |
| List of property names as array of strings. | |
| TSTriggerExpressionParser | getTriggerExpressionParser () |
| Trigger expression parser. | |
| int | hashCode () |
| Hash code. | |
| bool | hasPropertyNamed (String name) |
| Named property is present. | |
| Object | injectProperty (Object injectValue, Block ablock) |
| Process value visiting properties. | |
| void | loadAndAddElement (PersistencyEnvironment env, StubElement stub, FileReader reader, GameWorld gameWorld) |
| Load element from file reader and add it to game world. | |
| Element | loadElement (PersistencyEnvironment env, StubElement stub, FileReader reader) |
| Load element from file reader. | |
| void | removeAllProperties () |
| Remove all properties. | |
| void | removeProperty (ElementClassProperty property) |
| Remove property. | |
| void | setBasePath (String path) |
| Set base path for relative loading of resource properties. | |
| void | setIsXmlElementClass (bool isXmlElementClass) |
| Set if element class is an XML element class. | |
| void | setPersistable (bool persistable) |
| Set element class is persistable to file writers. | |
| void | setPropertyValue (String name, Object value) |
| Set value of named property. | |
Notification | |
Public Attributes | |
| Dictionary | pBehaviorFactories |
| Dictionary | pBehaviorIdMap |
| Array | pBehaviors |
| Array | pXmlBehaviorsInfo |
Static Public Attributes | |
| static BehaviorFactoryHelper | sharedFactoryHelper = BehaviorFactoryHelper.new() |
Protected Member Functions | |
| Element | createElement () |
| Create element instance. | |
Additional Inherited Members | |
Static Public Member Functions inherited from Dragengine.Scenery.ElementClass | |
| static CodecPropertyString | getSharedCodecPropertyString () |
| Shared property codec helper. | |
| static TSTriggerExpressionParser | getSharedTriggerExpressionParser () |
| Shared trigger expression parser. | |
| static void | setSharedCodecPropertyString (CodecPropertyString codec) |
| Set shared property codec helper. | |
| static void | setSharedTriggerExpressionParser (TSTriggerExpressionParser parser) |
| Set shared trigger expression parser. | |
Behavior element element class.
Behavior elements are jack of all trade elements. They allow building complex element behaviors by using behavior building blocks. These behavior building blocks are provided by ECBehavior classes attached to the element class.
Behavior elements are suited for prototyping and rapid development since they require little written code. For highly optimized elements building them using the conventional way might be a better option. For all other uses behavior elements are fast and reusable.
To create an element based on BehaviorElement create a new subclass of BehaviorElementClass and add all the desired ECBehavior instance. There is no need to subclas BehaviorElement. When creating a new instance the BehaviorElement is filled with ECBehavior created ECBehaviorInstance instances. These provide the actual behavior to the element.
Behaviors can also be created and added using XML element classes. Add the factories of all behavior types allowed to be created using #addBehaviorFactory(). By default no factory is present disabling support for XML behavior creation.
| void Dragengine.Scenery.BehaviorElementClass.addAttachableBehaviorFactories | ( | ) |
Add attachable behavior factories supported by this element class.
Default implementation calls #addDefaultAttachableBehaviorFactories().
| void Dragengine.Scenery.BehaviorElementClass.addAttachableBehaviorFactories | ( | AttachableBehaviorFactoryList | factories | ) |
Add attachable behavior factories replacing duplicates if present.
| void Dragengine.Scenery.BehaviorElementClass.addAttachableBehaviorFactory | ( | AttachableBehaviorFactory | factory | ) |
Add attachable behavior factory replacing duplicate if present.
| void Dragengine.Scenery.BehaviorElementClass.addBehavior | ( | ECBehavior | behavior | ) |
Add behavior.
This is called by constructors of class implementing ECBehavior. Usually you do not have to call this manually.
| void Dragengine.Scenery.BehaviorElementClass.addBehaviorFactories | ( | BehaviorFactoryList | factories | ) |
Add behavior factories replacing duplicates if present.
| void Dragengine.Scenery.BehaviorElementClass.addDefaultAttachableBehaviorFactories | ( | ) |
Add all attachable behavior factories present in the DragonScript module.
Add BaseGameApp::getAttachableBehaviorFactories().
| void Dragengine.Scenery.BehaviorElementClass.addDefaultBehaviorFactories | ( | ) |
Add all behavior factories present in the DragonScript module.
Add BaseGameApp::getBehaviorFactories().
| void Dragengine.Scenery.BehaviorElementClass.addXmlBehaviorInfo | ( | BehaviorFactory | factory, |
| String | id, | ||
| Dictionary | parameters | ||
| ) |
Add XML behavior information required for XML-XML subclassing.
| Array Dragengine.Scenery.BehaviorElementClass.collectBehaviors | ( | Block | ablock | ) |
Collect behaviors with block into Array.
Block is required to have one parameter ECBehavior or subclass thereof and returning true if the right behavior is found otherwise false. Block is called only for behaviors castable to block parameter type.
| void Dragengine.Scenery.BehaviorElementClass.createAndAddElement | ( | StubElement | stub, |
| GameWorld | gameWorld | ||
| ) |
Create element from given stub and add it to game world.
Calls BehaviorPrepareStub::prepareStub(StubElement,GameWorld,bool) on behaviors supporting stub preparation. Then calls BehaviorPreventCreation::preventCreation(StubElement,GameWorld) to check if creating and adding the element has to be cancelled. Then calls #createElement(StubElement) to obtain new element instance. If returned element is null no further processing is done. Otherwise element is added to gameWorld.
Reimplemented from Dragengine.Scenery.ElementClass.
|
protected |
Create element instance.
Reimplemented from Dragengine.Scenery.ElementClass.
Reimplemented in Dragengine.Scenery.BaseActorClass, Dragengine.Scenery.BaseVRActorClass, Dragengine.Scenery.AnimatedElementClass, Dragengine.Scenery.AttachableBaseBillboardClass, Dragengine.Scenery.AttachableBaseForceFieldClass, Dragengine.Scenery.AttachableBaseLightClass, Dragengine.Scenery.AttachableBaseParticleEmitterClass, Dragengine.Scenery.AttachableBaseSpeakerClass, Dragengine.Scenery.AttachSlotClass, Dragengine.Scenery.BaseBillboardClass, Dragengine.Scenery.BaseForceFieldClass, Dragengine.Scenery.BaseLightClass, Dragengine.Scenery.BaseParticleEmitterClass, Dragengine.Scenery.BaseSkyClass, Dragengine.Scenery.BaseSpeakerClass, Dragengine.Scenery.BaseWorldClass, Dragengine.Scenery.EnvironmentMapClass, Dragengine.Scenery.GhostElementClass, Dragengine.Scenery.HiddenElementClass, Dragengine.Scenery.InfoConvoCoordSystemClass, Dragengine.Scenery.PhysicsElementClass, Dragengine.Scenery.SimpleElementOnRailClass, Dragengine.Scenery.SimpleElementClass, Dragengine.Scenery.TriggerConversationClass, Dragengine.Scenery.TriggerEvaluateClass, Dragengine.Scenery.TriggerShoutClass, Dragengine.Scenery.TriggerTimerClass, Dragengine.Scenery.TriggerToggleClass, Dragengine.Scenery.TriggerTouchClass, and Dragengine.Scenery.TwoStateAnimatedElementClass.
| void Dragengine.Scenery.BehaviorElementClass.dispose | ( | ) |
Dispose of element class.
Reimplemented from Dragengine.Scenery.ElementClass.
| ECBehavior Dragengine.Scenery.BehaviorElementClass.findBehavior | ( | Block | ablock | ) |
Find behavior with block.
Block is required to have one parameter ECBehavior or subclass thereof and returning true if the right behavior is found otherwise false. Block is called only for behaviors castable to block parameter type.
| void Dragengine.Scenery.BehaviorElementClass.forEachAttachableBehaviorFactory | ( | Block | ablock | ) |
Visit attachable behavior factories.
Block receives as only argument AttachableBehaviorFactory.
| void Dragengine.Scenery.BehaviorElementClass.forEachBehavior | ( | Block | ablock | ) |
Visit behaviors with block.
Block is required to have one parameter of type ECBehavior or subclass thereof. Block is called only for behaviors castable to block parameter type.
| void Dragengine.Scenery.BehaviorElementClass.forEachBehaviorDirect | ( | Block | ablock | ) |
Visit behaviors with block.
Block is required to have one parameter of type ECBehavior. For use by BehaviorElement.
| void Dragengine.Scenery.BehaviorElementClass.forEachBehaviorFactory | ( | Block | ablock | ) |
Visit behavior factories.
Block receives as only argument BehaviorFactory.
| void Dragengine.Scenery.BehaviorElementClass.forEachPrepareStubBehavior | ( | Block | ablock | ) |
Visit prepare stub behaviors with block. version 1.23.
Block is required to have one parameter of type ECBehavior or subclass thereof. Block is called only for behaviors castable to block parameter type.
| void Dragengine.Scenery.BehaviorElementClass.forEachPreventCreationBehavior | ( | Block | ablock | ) |
Visit prevent creation behaviors with block. version 1.23.
Block is required to have one parameter of type ECBehavior or subclass thereof. Block is called only for behaviors castable to block parameter type.
| void Dragengine.Scenery.BehaviorElementClass.forEachXmlBehaviorInfo | ( | Block | ablock | ) |
Visit XML behavior info with block with argument XmlBehaviorInfo.
| AttachableBehaviorFactory Dragengine.Scenery.BehaviorElementClass.getAttachableBehaviorFactoryWithId | ( | String | id | ) |
Attachable behavior factory with identifier or null if absent.
| ECBehavior Dragengine.Scenery.BehaviorElementClass.getBehaviorAt | ( | int | index | ) |
Behavior at index.
| BehaviorFactory Dragengine.Scenery.BehaviorElementClass.getBehaviorFactoryWithId | ( | String | id | ) |
Behavior factory with identifier or null if absent.
| ECBehavior Dragengine.Scenery.BehaviorElementClass.getBehaviorWithId | ( | String | id | ) |
Behavior with matching BehaviorCompatiblePersistency::getBehaviorID() or null.
For use with persistency compatible behaviors.
| BehaviorElementClass Dragengine.Scenery.BehaviorElementClass.new | ( | ) |
Create element class using loaders from BaseGameApp.
Reimplemented in Dragengine.Scenery.BaseActorClass, Dragengine.Scenery.BaseVRActorClass, Dragengine.Scenery.AnimatedElementClass, Dragengine.Scenery.AttachableBaseBillboardClass, Dragengine.Scenery.AttachableBaseForceFieldClass, Dragengine.Scenery.AttachableBaseLightClass, Dragengine.Scenery.AttachableBaseParticleEmitterClass, Dragengine.Scenery.AttachableBaseSpeakerClass, Dragengine.Scenery.AttachSlotClass, Dragengine.Scenery.BaseBillboardClass, Dragengine.Scenery.BaseForceFieldClass, Dragengine.Scenery.BaseLightClass, Dragengine.Scenery.BaseParticleEmitterClass, Dragengine.Scenery.BaseSkyClass, Dragengine.Scenery.BaseSpeakerClass, Dragengine.Scenery.BaseWorldClass, Dragengine.Scenery.EnvironmentMapClass, Dragengine.Scenery.GenericBehaviorElementClass, Dragengine.Scenery.GhostElementClass, Dragengine.Scenery.HiddenElementClass, Dragengine.Scenery.InfoConvoCoordSystemClass, Dragengine.Scenery.PhysicsElementClass, Dragengine.Scenery.SimpleElementOnRailClass, Dragengine.Scenery.SimpleElementClass, and Dragengine.Scenery.TwoStateAnimatedElementClass.
| BehaviorElementClass Dragengine.Scenery.BehaviorElementClass.new | ( | Loaders | loaders | ) |
Create element class.
Reimplemented in Dragengine.Scenery.BaseSkyClass, Dragengine.Scenery.GhostElementClass, and Dragengine.Scenery.SimpleElementClass.
| BehaviorElementClass Dragengine.Scenery.BehaviorElementClass.new | ( | String | className | ) |
Create element class using loaders from BaseGameApp.
Reimplemented from Dragengine.Scenery.ElementClass.
Reimplemented in Dragengine.Scenery.BaseActorClass, Dragengine.Scenery.BaseVRActorClass, Dragengine.Scenery.AnimatedElementClass, Dragengine.Scenery.AttachableBaseBillboardClass, Dragengine.Scenery.AttachableBaseForceFieldClass, Dragengine.Scenery.AttachableBaseLightClass, Dragengine.Scenery.AttachableBaseParticleEmitterClass, Dragengine.Scenery.AttachableBaseSpeakerClass, Dragengine.Scenery.AttachSlotClass, Dragengine.Scenery.BaseBillboardClass, Dragengine.Scenery.BaseForceFieldClass, Dragengine.Scenery.BaseLightClass, Dragengine.Scenery.BaseParticleEmitterClass, Dragengine.Scenery.BaseSkyClass, Dragengine.Scenery.BaseSpeakerClass, Dragengine.Scenery.BaseWorldClass, Dragengine.Scenery.GenericBehaviorElementClass, Dragengine.Scenery.GhostElementClass, Dragengine.Scenery.HiddenElementClass, Dragengine.Scenery.PhysicsElementClass, Dragengine.Scenery.SimpleElementOnRailClass, Dragengine.Scenery.SimpleElementClass, Dragengine.Scenery.TwoStateAnimatedElementClass, Dragengine.Scenery.EnvironmentMapClass, and Dragengine.Scenery.InfoConvoCoordSystemClass.
| BehaviorElementClass Dragengine.Scenery.BehaviorElementClass.new | ( | String | className, |
| Loaders | loaders | ||
| ) |
Create element class.
Reimplemented in Dragengine.Scenery.BaseSkyClass, Dragengine.Scenery.GhostElementClass, and Dragengine.Scenery.SimpleElementClass.
| void Dragengine.Scenery.BehaviorElementClass.prepareStubs | ( | StubElement | stub, |
| GameWorld | gameWorld, | ||
| bool | loading | ||
| ) |
Call prepareStub on all prepare stub behaviors.
For use by subclasses overwriting #createAndAddElement(StubElement,GameWorld) or #loadAndAddElement(PersistencyEnvironment,StubElement,FileReader,GameWorld) without super calling.
| bool Dragengine.Scenery.BehaviorElementClass.preventCreation | ( | StubElement | stub, |
| GameWorld | gameWorld | ||
| ) |
Call prepareStub on all prepare stub behaviors.
For use by subclasses overwriting #createAndAddElement(StubElement,GameWorld) without super calling.
| void Dragengine.Scenery.BehaviorElementClass.removeAllAttachableBehaviorFactories | ( | ) |
Remove all attachable behavior factories.
| void Dragengine.Scenery.BehaviorElementClass.removeAllBehaviorFactories | ( | ) |
Remove all behavior factories.
| Dictionary Dragengine.Scenery.BehaviorElementClass.pBehaviorFactories |
| Dictionary Dragengine.Scenery.BehaviorElementClass.pBehaviorIdMap |
| Array Dragengine.Scenery.BehaviorElementClass.pBehaviors |
| Array Dragengine.Scenery.BehaviorElementClass.pXmlBehaviorsInfo |
|
static |