|
Drag[en]gine Script Module DragonScript 1.35
|
Default implementation of GWBehavior doing nothing. More...
Public Member Functions | |
| void | dispose () |
| Dispose of behavior. | |
| String | getBehaviorID () |
| Unique identifier of behavior. | |
| GameWorld | getGameWorld () |
| Game world this behavior belongs to. | |
| String | getID () |
| Identifier. | |
| void | init (StubGameWorld stub) |
| Initialize game world from stub. | |
| void | loadSupportedData (String identifier, PersistencyEnvironment env, FileReader reader) |
| Load data of another behavior. | |
| DefaultGWBehavior | new (GameWorld gameWorld) |
| Create default behavior with empty identifier. | |
| DefaultGWBehavior | new (GameWorld gameWorld, String id) |
| Create default behavior. | |
| void | postThink (float elapsed) |
| Post thinking after physics processing is finished. | |
| void | readFromFile (PersistencyEnvironment env, FileReader reader) |
| Read from file. | |
| bool | requiresPersistency () |
| Behavior requires readFromFile() and writeToFile() to be called. | |
| bool | requiresThink () |
| Behavior instance requires update(), think() and postThink() to be called. | |
| bool | supportsBehaviorID (String identifier) |
| Behavior supports loading data of another behavior. | |
| void | think (float elapsed) |
| Think about what to do for the next frame update. | |
| void | update (float elapsed) |
| Frame update. | |
| void | writeToFile (PersistencyEnvironment env, FileWriter writer) |
| Write to file. | |
Protected Member Functions | |
| void | setBehaviorID (String identifier) |
| Set behavior identifier. | |
| void | setRequiresPersistency (bool required) |
| Set if behavior requires readFromFile() and writeToFile() to be called. | |
| void | setRequiresThink (bool required) |
| Set if behavior instance requires update(), think() and postThink() to be called. | |
| void | useClassNameAsBehaviorID () |
| Set behavior identifier to "<class-name>:<identifier>". | |
| void | useFullyQualifiedClassNameAsBehaviorID () |
| Set behavior identifier to "<fully-qualified-class-name>:<identifier>". | |
Default implementation of GWBehavior doing nothing.
| void Dragengine.Scenery.DefaultGWBehavior.dispose | ( | ) |
Dispose of behavior.
Implements Dragengine.Scenery.GWBehavior.
Reimplemented in Dragengine.Scenery.GWBehaviorAnchoredElements, Dragengine.Scenery.GWBehaviorBTSM, and Dragengine.Scenery.GWBehaviorOneShotSpeaker.
References new().
Referenced by getGameWorld().
| String Dragengine.Scenery.DefaultGWBehavior.getBehaviorID | ( | ) |
Unique identifier of behavior.
Has to return a string which is unique in the owner GameWorld. This string will be stored. This allows to assign restored behavior data to the correct behavior if present.
The default implementation returns "<class-name>:<identifier>" or "<class-name>" if identifier is empty string (constructor calls useClassNameAsBehaviorID()). If two or more behaviors share the same class name you have to make sure getBehaviorID() returns unique names. This can be done using one of these possible ways:
Implements Dragengine.Scenery.GWBehavior.
Referenced by useClassNameAsBehaviorID().
| GameWorld Dragengine.Scenery.DefaultGWBehavior.getGameWorld | ( | ) |
Game world this behavior belongs to.
Implements Dragengine.Scenery.GWBehavior.
References dispose(), getGameWorld(), getID(), and useClassNameAsBehaviorID().
Referenced by Dragengine.Scenery.GWBehaviorOneShotSpeaker.getBehaviorIn(), getGameWorld(), and Dragengine.Scenery.GWBehaviorOneShotSpeaker.playSoundOnce().
| String Dragengine.Scenery.DefaultGWBehavior.getID | ( | ) |
Identifier.
Referenced by getGameWorld().
| void Dragengine.Scenery.DefaultGWBehavior.init | ( | StubGameWorld | stub | ) |
Initialize game world from stub.
Implements Dragengine.Scenery.GWBehavior.
Reimplemented in Dragengine.Scenery.GWBehaviorBTSM, and Dragengine.Scenery.GWBehaviorParameterTree.
References new().
Referenced by writeToFile().
| void Dragengine.Scenery.DefaultGWBehavior.loadSupportedData | ( | String | identifier, |
| PersistencyEnvironment | env, | ||
| FileReader | reader ) |
Load data of another behavior.
Called if supportsBehaviorID(String) returns true for identifier. GameWorld requests behavior to load the supported data block.
Implements Dragengine.Scenery.GWBehavior.
References loadSupportedData(), new(), postThink(), readFromFile(), requiresPersistency(), setRequiresPersistency(), supportsBehaviorID(), think(), update(), and writeToFile().
Referenced by loadSupportedData().
| DefaultGWBehavior Dragengine.Scenery.DefaultGWBehavior.new | ( | GameWorld | gameWorld | ) |
Create default behavior with empty identifier.
Reimplemented in Dragengine.Scenery.GWBehaviorAnchoredElements, Dragengine.Scenery.GWBehaviorBTSM, Dragengine.Scenery.GWBehaviorOneShotSpeaker, and Dragengine.Scenery.GWBehaviorParameterTree.
References new().
Referenced by dispose(), init(), loadSupportedData(), new(), new(), and useFullyQualifiedClassNameAsBehaviorID().
| DefaultGWBehavior Dragengine.Scenery.DefaultGWBehavior.new | ( | GameWorld | gameWorld, |
| String | id ) |
Create default behavior.
References new().
| void Dragengine.Scenery.DefaultGWBehavior.postThink | ( | float | elapsed | ) |
Post thinking after physics processing is finished.
Post think is called first on all elements then on all behaviors.
Implements Dragengine.Scenery.GWBehavior.
References useFullyQualifiedClassNameAsBehaviorID().
Referenced by Dragengine.Scenery.GWBehaviorOneShotSpeaker.getBehaviorIn(), and loadSupportedData().
| void Dragengine.Scenery.DefaultGWBehavior.readFromFile | ( | PersistencyEnvironment | env, |
| FileReader | reader ) |
| bool Dragengine.Scenery.DefaultGWBehavior.requiresPersistency | ( | ) |
Behavior requires readFromFile() and writeToFile() to be called.
Implements Dragengine.Scenery.GWBehavior.
Referenced by loadSupportedData().
| bool Dragengine.Scenery.DefaultGWBehavior.requiresThink | ( | ) |
Behavior instance requires update(), think() and postThink() to be called.
Implements Dragengine.Scenery.GWBehavior.
Referenced by writeToFile().
|
protected |
Set behavior identifier.
Referenced by useFullyQualifiedClassNameAsBehaviorID().
|
protected |
Set if behavior requires readFromFile() and writeToFile() to be called.
Referenced by loadSupportedData().
|
protected |
Set if behavior instance requires update(), think() and postThink() to be called.
Referenced by Dragengine.Scenery.GWBehaviorOneShotSpeaker.dispose(), and writeToFile().
| bool Dragengine.Scenery.DefaultGWBehavior.supportsBehaviorID | ( | String | identifier | ) |
Behavior supports loading data of another behavior.
Returns true if this behavior supports loading data of another behavior matching behavior identifier. Called for all behaviors if GameWorld encounters a data block with a behavior identifier not matching any behaviors.
Implements Dragengine.Scenery.GWBehavior.
Referenced by loadSupportedData().
| void Dragengine.Scenery.DefaultGWBehavior.think | ( | float | elapsed | ) |
Think about what to do for the next frame update.
Think is called first on all behaviors then on all elements.
Implements Dragengine.Scenery.GWBehavior.
Referenced by loadSupportedData().
| void Dragengine.Scenery.DefaultGWBehavior.update | ( | float | elapsed | ) |
Frame update.
Update is called on behaviors before enter frame and world updating is called.
Implements Dragengine.Scenery.GWBehavior.
References useClassNameAsBehaviorID().
Referenced by loadSupportedData().
|
protected |
Set behavior identifier to "<class-name>:<identifier>".
If identifier is empty string omits the double-colon.
References getBehaviorID().
Referenced by getGameWorld(), and update().
|
protected |
Set behavior identifier to "<fully-qualified-class-name>:<identifier>".
If identifier is empty string omits the double-colon.
References new(), and setBehaviorID().
Referenced by postThink().
| void Dragengine.Scenery.DefaultGWBehavior.writeToFile | ( | PersistencyEnvironment | env, |
| FileWriter | writer ) |
Write to file.
Implements Dragengine.Scenery.GWBehavior.
References init(), requiresThink(), and setRequiresThink().
Referenced by loadSupportedData().