|
Drag[en]gine Script Module DragonScript 1.35
|
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. | |
| Public Member Functions inherited from Dragengine.ResourceListener | |
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().
References new().
| void Dragengine.Scenery.BehaviorElementClass.addAttachableBehaviorFactories | ( | AttachableBehaviorFactoryList | factories | ) |
Add attachable behavior factories replacing duplicates if present.
Referenced by addBehavior(), and createAndAddElement().
| void Dragengine.Scenery.BehaviorElementClass.addAttachableBehaviorFactory | ( | AttachableBehaviorFactory | factory | ) |
Add attachable behavior factory replacing duplicate if present.
References forEachPrepareStubBehavior().
Referenced by createAndAddElement().
| 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.
References addAttachableBehaviorFactories(), dispose(), pBehaviorIdMap, and pBehaviors.
Referenced by forEachBehaviorDirect().
| void Dragengine.Scenery.BehaviorElementClass.addBehaviorFactories | ( | BehaviorFactoryList | factories | ) |
Add behavior factories replacing duplicates if present.
References pBehaviors.
Referenced by createAndAddElement().
| void Dragengine.Scenery.BehaviorElementClass.addDefaultAttachableBehaviorFactories | ( | ) |
Add all attachable behavior factories present in the DragonScript module.
Add BaseGameApp.getAttachableBehaviorFactories().
Referenced by createAndAddElement().
| void Dragengine.Scenery.BehaviorElementClass.addDefaultBehaviorFactories | ( | ) |
Add all behavior factories present in the DragonScript module.
Add BaseGameApp.getBehaviorFactories().
References pBehaviorIdMap.
Referenced by createAndAddElement(), Dragengine.Scenery.BaseActorClass.createElement(), and Dragengine.Scenery.GenericBehaviorElementClass.duplicateNamed().
| void Dragengine.Scenery.BehaviorElementClass.addXmlBehaviorInfo | ( | BehaviorFactory | factory, |
| String | id, | ||
| Dictionary | parameters ) |
Add XML behavior information required for XML-XML subclassing.
References new().
Referenced by createAndAddElement().
| 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.
References getBehaviorAt(), and pBehaviors.
Referenced by forEachPreventCreationBehavior().
| 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.
References addAttachableBehaviorFactories(), addAttachableBehaviorFactory(), addBehaviorFactories(), addDefaultAttachableBehaviorFactories(), addDefaultBehaviorFactories(), addXmlBehaviorInfo(), createAndAddElement(), createElement(), forEachAttachableBehaviorFactory(), forEachBehaviorFactory(), forEachXmlBehaviorInfo(), getAttachableBehaviorFactoryWithId(), getBehaviorFactoryWithId(), Dragengine.Scenery.ElementClass.loadAndAddElement(), new(), pBehaviorFactories, preventCreation(), pXmlBehaviorsInfo, removeAllAttachableBehaviorFactories(), and removeAllBehaviorFactories().
Referenced by createAndAddElement().
|
protected |
Create element instance.
Reimplemented from Dragengine.Scenery.ElementClass.
Reimplemented in Dragengine.Gui.MainMenus.Interactive.IMMEnvironmentMapClass, Dragengine.Gui.MainMenus.Interactive.IMMHotSpotClass, Dragengine.Gui.MainMenus.Interactive.IMMLightClass, Dragengine.Gui.MainMenus.Interactive.IMMParticleEmitterClass, Dragengine.Gui.MainMenus.Interactive.IMMPropClass, Dragengine.Gui.MainMenus.Interactive.IMMSpeakerClass, Dragengine.Scenery.AnimatedElementClass, Dragengine.Scenery.AttachableBaseBillboardClass, Dragengine.Scenery.AttachableBaseForceFieldClass, Dragengine.Scenery.AttachableBaseLightClass, Dragengine.Scenery.AttachableBaseParticleEmitterClass, Dragengine.Scenery.AttachableBaseSpeakerClass, Dragengine.Scenery.AttachSlotClass, Dragengine.Scenery.BaseActorClass, Dragengine.Scenery.BaseBillboardClass, Dragengine.Scenery.BaseForceFieldClass, Dragengine.Scenery.BaseLightClass, Dragengine.Scenery.BaseParticleEmitterClass, Dragengine.Scenery.BaseSkyClass, Dragengine.Scenery.BaseSpeakerClass, Dragengine.Scenery.BaseVRActorClass, Dragengine.Scenery.BaseWorldClass, Dragengine.Scenery.EnvironmentMapClass, Dragengine.Scenery.GhostElementClass, Dragengine.Scenery.HiddenElementClass, Dragengine.Scenery.InfoConvoCoordSystemClass, Dragengine.Scenery.PhysicsElementClass, Dragengine.Scenery.SimpleElementClass, Dragengine.Scenery.SimpleElementOnRailClass, Dragengine.Scenery.TriggerConversationClass, Dragengine.Scenery.TriggerEvaluateClass, Dragengine.Scenery.TriggerShoutClass, Dragengine.Scenery.TriggerTimerClass, Dragengine.Scenery.TriggerToggleClass, Dragengine.Scenery.TriggerTouchClass, Dragengine.Scenery.TwoStateAnimatedElementClass, Dragengine.TestSystem.TestCaseECBehavior.TestBehaviorElementClass, and Dragengine.TestSystem.TestCaseECBehaviorPersistency.TestBehaviorElementClass.
References forEachPreventCreationBehavior().
Referenced by createAndAddElement().
| void Dragengine.Scenery.BehaviorElementClass.dispose | ( | ) |
Dispose of element class.
Reimplemented from Dragengine.Scenery.ElementClass.
Reimplemented in Dragengine.TestSystem.TestCaseECBehavior.TestBehaviorElementClass, and Dragengine.TestSystem.TestCaseECBehaviorPersistency.TestBehaviorElementClass.
References new().
Referenced by addBehavior(), and findBehavior().
| 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.
References dispose(), and pBehaviors.
Referenced by prepareStubs().
| void Dragengine.Scenery.BehaviorElementClass.forEachAttachableBehaviorFactory | ( | Block | ablock | ) |
Visit attachable behavior factories.
Block receives as only argument AttachableBehaviorFactory.
Referenced by createAndAddElement().
| 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.
References pBehaviorFactories, and pBehaviors.
Referenced by forEachPrepareStubBehavior().
| 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.
References addBehavior(), and pBehaviors.
Referenced by preventCreation().
| void Dragengine.Scenery.BehaviorElementClass.forEachBehaviorFactory | ( | Block | ablock | ) |
Visit behavior factories.
Block receives as only argument BehaviorFactory.
Referenced by createAndAddElement().
| 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.
References forEachBehavior(), and pBehaviors.
Referenced by addAttachableBehaviorFactory().
| 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.
References collectBehaviors(), and pBehaviors.
Referenced by createElement().
| void Dragengine.Scenery.BehaviorElementClass.forEachXmlBehaviorInfo | ( | Block | ablock | ) |
Visit XML behavior info with block with argument XmlBehaviorInfo.
Referenced by createAndAddElement().
| AttachableBehaviorFactory Dragengine.Scenery.BehaviorElementClass.getAttachableBehaviorFactoryWithId | ( | String | id | ) |
Attachable behavior factory with identifier or null if absent.
Referenced by createAndAddElement().
| ECBehavior Dragengine.Scenery.BehaviorElementClass.getBehaviorAt | ( | int | index | ) |
Behavior at index.
References new(), pBehaviorFactories, pBehaviors, and pXmlBehaviorsInfo.
Referenced by collectBehaviors().
| BehaviorFactory Dragengine.Scenery.BehaviorElementClass.getBehaviorFactoryWithId | ( | String | id | ) |
Behavior factory with identifier or null if absent.
Referenced by createAndAddElement().
| ECBehavior Dragengine.Scenery.BehaviorElementClass.getBehaviorWithId | ( | String | id | ) |
Behavior with matching BehaviorCompatiblePersistency.getBehaviorID() or null.
For use with persistency compatible behaviors.
References new(), and pBehaviors.
Referenced by removeAllBehaviorFactories().
| BehaviorElementClass Dragengine.Scenery.BehaviorElementClass.new | ( | ) |
Create element class using loaders from BaseGameApp.
Reimplemented in Dragengine.Scenery.AnimatedElementClass, Dragengine.Scenery.AttachableBaseBillboardClass, Dragengine.Scenery.AttachableBaseForceFieldClass, Dragengine.Scenery.AttachableBaseLightClass, Dragengine.Scenery.AttachableBaseParticleEmitterClass, Dragengine.Scenery.AttachableBaseSpeakerClass, Dragengine.Scenery.AttachSlotClass, Dragengine.Scenery.BaseActorClass, Dragengine.Scenery.BaseBillboardClass, Dragengine.Scenery.BaseForceFieldClass, Dragengine.Scenery.BaseLightClass, Dragengine.Scenery.BaseParticleEmitterClass, Dragengine.Scenery.BaseSkyClass, Dragengine.Scenery.BaseSpeakerClass, Dragengine.Scenery.BaseVRActorClass, Dragengine.Scenery.BaseWorldClass, Dragengine.Scenery.EnvironmentMapClass, Dragengine.Scenery.GenericBehaviorElementClass, Dragengine.Scenery.GhostElementClass, Dragengine.Scenery.HiddenElementClass, Dragengine.Scenery.InfoConvoCoordSystemClass, Dragengine.Scenery.PhysicsElementClass, Dragengine.Scenery.SimpleElementClass, Dragengine.Scenery.SimpleElementOnRailClass, and Dragengine.Scenery.TwoStateAnimatedElementClass.
Referenced by addAttachableBehaviorFactories(), addXmlBehaviorInfo(), createAndAddElement(), dispose(), getBehaviorAt(), getBehaviorWithId(), new(), new(), and removeAllBehaviorFactories().
| BehaviorElementClass Dragengine.Scenery.BehaviorElementClass.new | ( | Loaders | loaders | ) |
Create element class.
Reimplemented in Dragengine.Scenery.BaseSkyClass, Dragengine.Scenery.GhostElementClass, and Dragengine.Scenery.SimpleElementClass.
References new().
| BehaviorElementClass Dragengine.Scenery.BehaviorElementClass.new | ( | String | className | ) |
Create element class using loaders from BaseGameApp.
Reimplemented from Dragengine.Scenery.ElementClass.
Reimplemented in Dragengine.Scenery.AnimatedElementClass, Dragengine.Scenery.AttachableBaseBillboardClass, Dragengine.Scenery.AttachableBaseForceFieldClass, Dragengine.Scenery.AttachableBaseLightClass, Dragengine.Scenery.AttachableBaseParticleEmitterClass, Dragengine.Scenery.AttachableBaseSpeakerClass, Dragengine.Scenery.AttachSlotClass, Dragengine.Scenery.BaseActorClass, Dragengine.Scenery.BaseBillboardClass, Dragengine.Scenery.BaseForceFieldClass, Dragengine.Scenery.BaseLightClass, Dragengine.Scenery.BaseParticleEmitterClass, Dragengine.Scenery.BaseSkyClass, Dragengine.Scenery.BaseSpeakerClass, Dragengine.Scenery.BaseVRActorClass, Dragengine.Scenery.BaseWorldClass, Dragengine.Scenery.EnvironmentMapClass, Dragengine.Scenery.GenericBehaviorElementClass, Dragengine.Scenery.GhostElementClass, Dragengine.Scenery.HiddenElementClass, Dragengine.Scenery.InfoConvoCoordSystemClass, Dragengine.Scenery.PhysicsElementClass, Dragengine.Scenery.SimpleElementClass, Dragengine.Scenery.SimpleElementOnRailClass, and Dragengine.Scenery.TwoStateAnimatedElementClass.
References new().
| 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.
References findBehavior(), and pBehaviors.
Referenced by removeAllAttachableBehaviorFactories().
| 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.
References forEachBehaviorDirect().
Referenced by createAndAddElement().
| void Dragengine.Scenery.BehaviorElementClass.removeAllAttachableBehaviorFactories | ( | ) |
Remove all attachable behavior factories.
References prepareStubs().
Referenced by createAndAddElement().
| void Dragengine.Scenery.BehaviorElementClass.removeAllBehaviorFactories | ( | ) |
Remove all behavior factories.
References getBehaviorWithId(), new(), pBehaviorIdMap, and pBehaviors.
Referenced by createAndAddElement().
| Dictionary Dragengine.Scenery.BehaviorElementClass.pBehaviorFactories |
Referenced by createAndAddElement(), forEachBehavior(), and getBehaviorAt().
| Dictionary Dragengine.Scenery.BehaviorElementClass.pBehaviorIdMap |
Referenced by addBehavior(), addDefaultBehaviorFactories(), and removeAllBehaviorFactories().
| Array Dragengine.Scenery.BehaviorElementClass.pBehaviors |
| Array Dragengine.Scenery.BehaviorElementClass.pXmlBehaviorsInfo |
Referenced by createAndAddElement(), and getBehaviorAt().
|
static |