Drag[en]gine Script Module DragonScript  1.23
Dragengine.TriggerSystem.TSNamedTriggerTarget Class Reference

Helper class operating an named trigger target. More...

Inheritance diagram for Dragengine.TriggerSystem.TSNamedTriggerTarget:

Public Member Functions

void acquireTarget (TSTriggerTable triggerTable)
 Acquire trigger target if name is not empty. More...
 
void addListener (TSTriggerListener listener)
 Add listener to trigger target if present. More...
 
void dropTarget ()
 Drop trigger target if present. More...
 
void fire ()
 Fire trigger target if present. More...
 
void fullReset ()
 Fully reset trigger target if present. More...
 
bool getFired ()
 Trigger target fired state or false if absent. More...
 
bool getHasFired ()
 Target target ever fired state or false if absent. More...
 
StringID getName ()
 Name. More...
 
TSTriggerTarget getTarget ()
 Trigger target or null if not acquired yet. More...
 
TSNamedTriggerTarget new ()
 Create named trigger target. More...
 
TSNamedTriggerTarget new (String name)
 
TSNamedTriggerTarget new (StringID name)
 Create named trigger target with initial name. More...
 
void pulse ()
 Fire then reset trigger target if present. More...
 
void removeListener (TSTriggerListener listener)
 Remove listener from trigger target if present. More...
 
void reset ()
 Reset trigger target if present. More...
 
void setFired (bool fired)
 Set trigger target fire state if present. More...
 
void setHasFired (bool hasFired)
 Set if trigger target ever fired state if present. More...
 
void setName (String name)
 Set name or empty string or null if not used. More...
 
void setName (StringID name)
 Set name or null if not used. More...
 
void toggle ()
 Toggle between fired and reset state. More...
 

Public Attributes

StringID pName
 
TSTriggerTarget pTarget
 

Detailed Description

Helper class operating an named trigger target.

Simplifies the process of handling optional trigger targets. The class stores the name of the trigger target and the trigger target itself. The trigger target is fetched from the trigger table if the name is not null. This class hides the book keeping for this common situation.

Member Function Documentation

◆ acquireTarget()

void Dragengine.TriggerSystem.TSNamedTriggerTarget.acquireTarget ( TSTriggerTable  triggerTable)

Acquire trigger target if name is not empty.

Call this during Element.addToGameWorld().

◆ addListener()

void Dragengine.TriggerSystem.TSNamedTriggerTarget.addListener ( TSTriggerListener  listener)

Add listener to trigger target if present.

◆ dropTarget()

void Dragengine.TriggerSystem.TSNamedTriggerTarget.dropTarget ( )

Drop trigger target if present.

Call this during Element.removeFromGameWorld() or when the trigger table is no more valid.

◆ fire()

void Dragengine.TriggerSystem.TSNamedTriggerTarget.fire ( )

Fire trigger target if present.

◆ fullReset()

void Dragengine.TriggerSystem.TSNamedTriggerTarget.fullReset ( )

Fully reset trigger target if present.

◆ getFired()

bool Dragengine.TriggerSystem.TSNamedTriggerTarget.getFired ( )

Trigger target fired state or false if absent.

◆ getHasFired()

bool Dragengine.TriggerSystem.TSNamedTriggerTarget.getHasFired ( )

Target target ever fired state or false if absent.

◆ getName()

StringID Dragengine.TriggerSystem.TSNamedTriggerTarget.getName ( )

Name.

◆ getTarget()

TSTriggerTarget Dragengine.TriggerSystem.TSNamedTriggerTarget.getTarget ( )

Trigger target or null if not acquired yet.

◆ new() [1/3]

TSNamedTriggerTarget Dragengine.TriggerSystem.TSNamedTriggerTarget.new ( )

Create named trigger target.

◆ new() [2/3]

TSNamedTriggerTarget Dragengine.TriggerSystem.TSNamedTriggerTarget.new ( String  name)

◆ new() [3/3]

TSNamedTriggerTarget Dragengine.TriggerSystem.TSNamedTriggerTarget.new ( StringID  name)

Create named trigger target with initial name.

◆ pulse()

void Dragengine.TriggerSystem.TSNamedTriggerTarget.pulse ( )

Fire then reset trigger target if present.

◆ removeListener()

void Dragengine.TriggerSystem.TSNamedTriggerTarget.removeListener ( TSTriggerListener  listener)

Remove listener from trigger target if present.

◆ reset()

void Dragengine.TriggerSystem.TSNamedTriggerTarget.reset ( )

Reset trigger target if present.

◆ setFired()

void Dragengine.TriggerSystem.TSNamedTriggerTarget.setFired ( bool  fired)

Set trigger target fire state if present.

◆ setHasFired()

void Dragengine.TriggerSystem.TSNamedTriggerTarget.setHasFired ( bool  hasFired)

Set if trigger target ever fired state if present.

◆ setName() [1/2]

void Dragengine.TriggerSystem.TSNamedTriggerTarget.setName ( String  name)

Set name or empty string or null if not used.

Drops the trigger target if present.

◆ setName() [2/2]

void Dragengine.TriggerSystem.TSNamedTriggerTarget.setName ( StringID  name)

Set name or null if not used.

Drops the trigger target if present.

◆ toggle()

void Dragengine.TriggerSystem.TSNamedTriggerTarget.toggle ( )

Toggle between fired and reset state.

Version
1.19

Member Data Documentation

◆ pName

StringID Dragengine.TriggerSystem.TSNamedTriggerTarget.pName

◆ pTarget

TSTriggerTarget Dragengine.TriggerSystem.TSNamedTriggerTarget.pTarget

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