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

Application behavior element adding timer support to behavior trees and state machines. More...

Inheritance diagram for Dragengine.Scenery.GABehaviorTimers:
Dragengine.DefaultGABehavior Dragengine.GABehavior

Classes

class  TrackedTimer
 Timer. More...

Public Member Functions

void cleanUp ()
 Clean up game.
GAComposeBTSM getBTSM ()
 Composable component for state machines.
String getPrefix ()
 Prefix.
float getTimerRemaining (String timer)
 Remaining time of timer or 0 if absent.
void initGame ()
 Initialize game.
bool isTimerRunning (String timer)
 Timer is present and running.
GABehaviorTimers new ()
 Create behavior.
void onFrameUpdate (float elapsed)
 Frame update.
void startTimer (String timer, float timeout)
 Start timer adding it if absent.
void stopTimer (String timer)
 Stop timer if present.
void updateTimers (float elapsed)
 Update timers.
Public Member Functions inherited from Dragengine.DefaultGABehavior
String getID ()
 Identifier.
DefaultGABehavior new (String id)
 Create default behavior.
void onAppActivate ()
 Application has received or lost focus.
void postInitGame ()
 Post initialize game.

Static Public Member Functions

static GABehaviorTimers getBehaviorInApp ()
 Get behavior in game app or null if absent.

Public Attributes

GAComposeBTSM pBTSMs
Array pElapsedTimers
String pPrefix
Dictionary pTimers
Public Attributes inherited from Dragengine.DefaultGABehavior
String pID

Detailed Description

Application behavior element adding timer support to behavior trees and state machines.

Version
1.35

Behavior adds actions, conditions and events allowing behavior trees and state machines to start, stop and wait for multiple independent timers.

This behavior can be added only once.

See also
https://developer.dragondreams.ch/wiki/doku.php/dragengine:modules:dragonscript:gabehavior_timers

Member Function Documentation

◆ cleanUp()

void Dragengine.Scenery.GABehaviorTimers.cleanUp ( )

Clean up game.

Called by BaseGameApp.cleanUp().

Reimplemented from Dragengine.DefaultGABehavior.

References startTimer().

Referenced by getBehaviorInApp().

◆ getBehaviorInApp()

GABehaviorTimers Dragengine.Scenery.GABehaviorTimers.getBehaviorInApp ( )
static

Get behavior in game app or null if absent.

Use this method to check if BaseGameApp contains behavior of type GABehaviorTimers.

References cleanUp(), getBehaviorInApp(), getBTSM(), getPrefix(), getTimerRemaining(), initGame(), isTimerRunning(), new(), onFrameUpdate(), pBTSMs, pElapsedTimers, pPrefix, pTimers, startTimer(), stopTimer(), and updateTimers().

Referenced by getBehaviorInApp().

◆ getBTSM()

GAComposeBTSM Dragengine.Scenery.GABehaviorTimers.getBTSM ( )

Composable component for state machines.

References new().

Referenced by getBehaviorInApp().

◆ getPrefix()

String Dragengine.Scenery.GABehaviorTimers.getPrefix ( )

Prefix.

Referenced by getBehaviorInApp().

◆ getTimerRemaining()

float Dragengine.Scenery.GABehaviorTimers.getTimerRemaining ( String timer)

Remaining time of timer or 0 if absent.

Referenced by getBehaviorInApp().

◆ initGame()

void Dragengine.Scenery.GABehaviorTimers.initGame ( )

Initialize game.

Called by BaseGameApp.initGame().

Reimplemented from Dragengine.DefaultGABehavior.

Referenced by getBehaviorInApp().

◆ isTimerRunning()

bool Dragengine.Scenery.GABehaviorTimers.isTimerRunning ( String timer)

Timer is present and running.

Referenced by getBehaviorInApp().

◆ new()

GABehaviorTimers Dragengine.Scenery.GABehaviorTimers.new ( )

Create behavior.

Reimplemented from Dragengine.DefaultGABehavior.

Referenced by getBehaviorInApp(), and getBTSM().

◆ onFrameUpdate()

void Dragengine.Scenery.GABehaviorTimers.onFrameUpdate ( float elapsed)

Frame update.

Called by BaseGameApp#onFrameUpdate(float).

Reimplemented from Dragengine.DefaultGABehavior.

Referenced by getBehaviorInApp().

◆ startTimer()

void Dragengine.Scenery.GABehaviorTimers.startTimer ( String timer,
float timeout )

Start timer adding it if absent.

Referenced by cleanUp(), and getBehaviorInApp().

◆ stopTimer()

void Dragengine.Scenery.GABehaviorTimers.stopTimer ( String timer)

Stop timer if present.

Referenced by getBehaviorInApp(), and updateTimers().

◆ updateTimers()

void Dragengine.Scenery.GABehaviorTimers.updateTimers ( float elapsed)

Update timers.

References stopTimer().

Referenced by getBehaviorInApp().

Member Data Documentation

◆ pBTSMs

GAComposeBTSM Dragengine.Scenery.GABehaviorTimers.pBTSMs

Referenced by getBehaviorInApp().

◆ pElapsedTimers

Array Dragengine.Scenery.GABehaviorTimers.pElapsedTimers

Referenced by getBehaviorInApp().

◆ pPrefix

String Dragengine.Scenery.GABehaviorTimers.pPrefix

Referenced by getBehaviorInApp().

◆ pTimers

Dictionary Dragengine.Scenery.GABehaviorTimers.pTimers

Referenced by getBehaviorInApp().


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