Drag[en]gine Script Module DragonScript  1.21
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.GWBehaviorOneShotSpeaker

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...
 

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.

◆ getGameWorld()

GameWorld Dragengine.Scenery.GWBehavior.getGameWorld ( )

Game world the behavior belongs to.

Implemented in Dragengine.Scenery.DefaultGWBehavior.

◆ init()

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

Initialize game world from stub.

Implemented in Dragengine.Scenery.DefaultGWBehavior.

◆ 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.

◆ 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.

◆ 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.

◆ requiresPersistency()

bool Dragengine.Scenery.GWBehavior.requiresPersistency ( )

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

Implemented in Dragengine.Scenery.DefaultGWBehavior.

◆ requiresThink()

bool Dragengine.Scenery.GWBehavior.requiresThink ( )

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

Implemented in Dragengine.Scenery.DefaultGWBehavior.

◆ 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.

◆ 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.

◆ 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.

◆ 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.


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