Drag[en]gine Script Module DragonScript
1.23
|
Helper class operating an named trigger target. More...
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 |
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.
void Dragengine.TriggerSystem.TSNamedTriggerTarget.acquireTarget | ( | TSTriggerTable | triggerTable | ) |
Acquire trigger target if name is not empty.
Call this during Element.addToGameWorld().
void Dragengine.TriggerSystem.TSNamedTriggerTarget.addListener | ( | TSTriggerListener | listener | ) |
Add listener to trigger target if present.
void Dragengine.TriggerSystem.TSNamedTriggerTarget.dropTarget | ( | ) |
Drop trigger target if present.
Call this during Element.removeFromGameWorld() or when the trigger table is no more valid.
void Dragengine.TriggerSystem.TSNamedTriggerTarget.fire | ( | ) |
Fire trigger target if present.
void Dragengine.TriggerSystem.TSNamedTriggerTarget.fullReset | ( | ) |
Fully reset trigger target if present.
bool Dragengine.TriggerSystem.TSNamedTriggerTarget.getFired | ( | ) |
Trigger target fired state or false if absent.
bool Dragengine.TriggerSystem.TSNamedTriggerTarget.getHasFired | ( | ) |
Target target ever fired state or false if absent.
StringID Dragengine.TriggerSystem.TSNamedTriggerTarget.getName | ( | ) |
Name.
TSTriggerTarget Dragengine.TriggerSystem.TSNamedTriggerTarget.getTarget | ( | ) |
Trigger target or null if not acquired yet.
TSNamedTriggerTarget Dragengine.TriggerSystem.TSNamedTriggerTarget.new | ( | ) |
Create named trigger target.
TSNamedTriggerTarget Dragengine.TriggerSystem.TSNamedTriggerTarget.new | ( | String | name | ) |
TSNamedTriggerTarget Dragengine.TriggerSystem.TSNamedTriggerTarget.new | ( | StringID | name | ) |
Create named trigger target with initial name.
void Dragengine.TriggerSystem.TSNamedTriggerTarget.pulse | ( | ) |
Fire then reset trigger target if present.
void Dragengine.TriggerSystem.TSNamedTriggerTarget.removeListener | ( | TSTriggerListener | listener | ) |
Remove listener from trigger target if present.
void Dragengine.TriggerSystem.TSNamedTriggerTarget.reset | ( | ) |
Reset trigger target if present.
void Dragengine.TriggerSystem.TSNamedTriggerTarget.setFired | ( | bool | fired | ) |
Set trigger target fire state if present.
void Dragengine.TriggerSystem.TSNamedTriggerTarget.setHasFired | ( | bool | hasFired | ) |
Set if trigger target ever fired state if present.
void Dragengine.TriggerSystem.TSNamedTriggerTarget.setName | ( | String | name | ) |
Set name or empty string or null if not used.
Drops the trigger target if present.
void Dragengine.TriggerSystem.TSNamedTriggerTarget.setName | ( | StringID | name | ) |
Set name or null if not used.
Drops the trigger target if present.
void Dragengine.TriggerSystem.TSNamedTriggerTarget.toggle | ( | ) |
Toggle between fired and reset state.
StringID Dragengine.TriggerSystem.TSNamedTriggerTarget.pName |
TSTriggerTarget Dragengine.TriggerSystem.TSNamedTriggerTarget.pTarget |