Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
Dragengine.Scenery.GWBehavior Interface Reference

GameWorld Behavior instance interface providing the actual game world behavior. More...

Inheritance diagram for Dragengine.Scenery.GWBehavior:
Dragengine.Scenery.DefaultGWBehavior Dragengine.Scenery.GWBehaviorAnchoredElements Dragengine.Scenery.GWBehaviorBTSM Dragengine.Scenery.GWBehaviorOneShotSpeaker Dragengine.Scenery.GWBehaviorParameterTree

Public Member Functions

void dispose ()
 Dispose of behavior.
String getBehaviorID ()
 Unique identifier of behavior.
GameWorld getGameWorld ()
 Game world the behavior belongs to.
void init (StubGameWorld stub)
 Initialize game world from stub.
void loadSupportedData (String identifier, PersistencyEnvironment env, FileReader reader)
 Load data of another 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.

Detailed Description

GameWorld Behavior instance interface providing the actual game world behavior.

Version
1.17

Member Function Documentation

◆ dispose()

void Dragengine.Scenery.GWBehavior.dispose ( )

◆ getBehaviorID()

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.

References loadSupportedData().

Referenced by writeToFile().

◆ getGameWorld()

GameWorld Dragengine.Scenery.GWBehavior.getGameWorld ( )

Game world the behavior belongs to.

Implemented in Dragengine.Scenery.DefaultGWBehavior.

References dispose(), and getGameWorld().

Referenced by getGameWorld().

◆ init()

void Dragengine.Scenery.GWBehavior.init ( StubGameWorld stub)

◆ loadSupportedData()

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.

Referenced by getBehaviorID().

◆ postThink()

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.

Referenced by think().

◆ readFromFile()

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.

Referenced by requiresPersistency().

◆ requiresPersistency()

bool Dragengine.Scenery.GWBehavior.requiresPersistency ( )

Behavior requires readFromFile() and writeToFile() to be called.

Implemented in Dragengine.Scenery.DefaultGWBehavior.

References readFromFile(), and writeToFile().

Referenced by think().

◆ requiresThink()

bool Dragengine.Scenery.GWBehavior.requiresThink ( )

Behavior instance requires update(), think() and postThink() to be called.

Implemented in Dragengine.Scenery.DefaultGWBehavior.

References update().

Referenced by init().

◆ supportsBehaviorID()

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.

Referenced by writeToFile().

◆ think()

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.

References postThink(), and requiresPersistency().

Referenced by update().

◆ update()

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.

References think().

Referenced by requiresThink().

◆ writeToFile()

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.

References getBehaviorID(), and supportsBehaviorID().

Referenced by requiresPersistency().


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