- Joined
- May 16, 2012
- Messages
- 644
Hello Hivers, recently i saw in a post that its better to do:
Then
because trigger actions create threads and trigger conditions do not. I dont quite understand the concept. What are the pros and cons of each method? Will it impact performance? Will it break MUIness?
JASS:
scope Test initializer Init
private function Actions takes nothing returns nothing
Do Something...
endfunction
private function Conditions takes nothing returns boolean
if Some_Condition_Check then
call Actions()
endif
return false
endfunction
//===========================================================================
private function Init takes nothing returns nothing
set gg_trg_Test = CreateTrigger()
call TriggerRegisterVariableEvent( gg_trg_Test, "udg_AnyVariable", EQUAL, 1.00 )
call TriggerAddCondition(gg_trg_Test, Condition( function Conditions ))
endfunction
endscope
Then
JASS:
scope Test initializer Init
private function Conditions takes nothing returns boolean
return Some_Condition_Check == true
endfunction
private function Actions takes nothing returns nothing
Do Something...
endfunction
//===========================================================================
private function Init takes nothing returns nothing
set gg_trg_Test = CreateTrigger()
call TriggerRegisterVariableEvent( gg_trg_Test, "udg_AnyVariable", EQUAL, 1.00 )
call TriggerAddCondition(gg_trg_Test, Condition( function Conditions ))
call TriggerAddAction( gg_trg_Test, function Actions )
endfunction
endscope
because trigger actions create threads and trigger conditions do not. I dont quite understand the concept. What are the pros and cons of each method? Will it impact performance? Will it break MUIness?