- Joined
- Jun 3, 2010
- Messages
- 47
Ugh, editing this post, firefox sucks ...
JASS:
library ObjectTrigger
public class Trigger
trigger t
public triggercondition lastTriggerCondition
public triggeraction lastTriggerAction
thistype addAction(code c)
set this.lastTriggerAction=TriggerAddCondition(this.t,c)
return this
thistype addCondition(boolexpr e)
set this.lastTriggerCondition=TriggerAddCondition(this.t,e)
return this
thistype execute()
call TriggerExecute(this.t)
return this
void destroy()
DestroyTrigger(this.t)
this.deallocate()
static thistype create()
thistype this=thistype.allocate()
this.t=CreateTrigger()
return this
filter SomeCondition()
BJDebugMsg("R.I.P. //!")
return true // I must return true in a filter or else it is false
void SomeAction()
BJDebugMsg("R.I.P. {}")
init // test
Trigger t=Trigger.create()
t.addAction(SomeAction)
t.addCondition(SomeCondition)
t.execute()
// or
Trigger t=Trigger.create().addAction(SomeAction).addCondition(SomeCondition).execute()