Drag[en]gine Script Module DragonScript
1.23
|
GameWorld Behavior instance interface providing the actual game world behavior. More...
Public Member Functions | |
void | dispose () |
Dispose of behavior. More... | |
String | getBehaviorID () |
Unique identifier of behavior. More... | |
GameWorld | getGameWorld () |
Game world the behavior belongs to. More... | |
void | init (StubGameWorld stub) |
Initialize game world from stub. More... | |
void | loadSupportedData (String identifier, PersistencyEnvironment env, FileReader reader) |
Load data of another behavior. More... | |
void | postThink (float elapsed) |
Post thinking after physics processing is finished. More... | |
void | readFromFile (PersistencyEnvironment env, FileReader reader) |
Read from file. More... | |
bool | requiresPersistency () |
Behavior requires readFromFile() and writeToFile() to be called. More... | |
bool | requiresThink () |
Behavior instance requires update(), think() and postThink() to be called. More... | |
bool | supportsBehaviorID (String identifier) |
Behavior supports loading data of another behavior. More... | |
void | think (float elapsed) |
Think about what to do for the next frame update. More... | |
void | update (float elapsed) |
Frame update. More... | |
void | writeToFile (PersistencyEnvironment env, FileWriter writer) |
Write to file. More... | |
GameWorld Behavior instance interface providing the actual game world behavior.
void Dragengine.Scenery.GWBehavior.dispose | ( | ) |
Dispose of behavior.
Implemented in Dragengine.Scenery.GWBehaviorOneShotSpeaker, and Dragengine.Scenery.DefaultGWBehavior.
String Dragengine.Scenery.GWBehavior.getBehaviorID | ( | ) |
Unique identifier of behavior.
Has to return a string which is unique in the owner GameWorld. This string will be stored while persisting GameWorld instances. This allows to assign restored behavior data to the correct behavior if present.
Implemented in Dragengine.Scenery.DefaultGWBehavior.
GameWorld Dragengine.Scenery.GWBehavior.getGameWorld | ( | ) |
Game world the behavior belongs to.
Implemented in Dragengine.Scenery.DefaultGWBehavior.
void Dragengine.Scenery.GWBehavior.init | ( | StubGameWorld | stub | ) |
Initialize game world from stub.
Implemented in Dragengine.Scenery.DefaultGWBehavior.
void Dragengine.Scenery.GWBehavior.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.
Implemented in Dragengine.Scenery.DefaultGWBehavior.
void Dragengine.Scenery.GWBehavior.postThink | ( | float | elapsed | ) |
Post thinking after physics processing is finished.
This method is only called if requiresThink() returns true. Post think is called first on all elements then on all behaviors.
Implemented in Dragengine.Scenery.DefaultGWBehavior.
void Dragengine.Scenery.GWBehavior.readFromFile | ( | PersistencyEnvironment | env, |
FileReader | reader | ||
) |
Read from file.
This method is only called if requiresPersistency() returns true.
Implemented in Dragengine.Scenery.DefaultGWBehavior.
bool Dragengine.Scenery.GWBehavior.requiresPersistency | ( | ) |
Behavior requires readFromFile() and writeToFile() to be called.
Implemented in Dragengine.Scenery.DefaultGWBehavior.
bool Dragengine.Scenery.GWBehavior.requiresThink | ( | ) |
Behavior instance requires update(), think() and postThink() to be called.
Implemented in Dragengine.Scenery.DefaultGWBehavior.
bool Dragengine.Scenery.GWBehavior.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.
Implemented in Dragengine.Scenery.DefaultGWBehavior.
void Dragengine.Scenery.GWBehavior.think | ( | float | elapsed | ) |
Think about what to do for the next frame update.
This method is only called if requiresThink() returns true. Think is called first on all behaviors then on all elements.
Implemented in Dragengine.Scenery.DefaultGWBehavior.
void Dragengine.Scenery.GWBehavior.update | ( | float | elapsed | ) |
Frame update.
This method is only called if requiresThink() returns true. Update is called on behaviors before enter frame and world updating is called.
Implemented in Dragengine.Scenery.DefaultGWBehavior.
void Dragengine.Scenery.GWBehavior.writeToFile | ( | PersistencyEnvironment | env, |
FileWriter | writer | ||
) |
Write to file.
This method is only called if requiresPersistency() returns true.
Implemented in Dragengine.Scenery.DefaultGWBehavior.