[messages] [Developers] Re: [Developers] Re: [Developers] Re: question ab

fil512 ken.stevens at sympatico.ca
Thu Jul 29 13:14:02 MST 2010


"mkiefte" wrote:
> 
> Trigger does all the inner (higher) traits first and then does it's
> action(s) which may fire other triggers which will be after that, etc.
> 


What do you mean by a "Trigger does all the inner traits first"?  Do you
mean that if a keystroke is hit that a Trigger is listening to, then the
trigger first sends that keystroke to all inner traits, then processes
the keystroke itself, and then the keystroke is sent to traits below the
Trigger?  If that is what you mean, then that would seem to contradict
the fact that triggers "always go last".  So I guess that probably means
that I don't understand what you mean by "does all the inner traits
first"...


"mkiefte" wrote:
> 
> > Programming shouldn't be about guesswork.  The rules about how
> VASSAL
> > works should be clear: no guessing; so we can all just get on with
> the
> > business of building modules.
> >
> 
> If the rules are still not clear, let me know.
> 


Thanks to your patience in answering my question, it is getting clearer
for me.  I guess I still don't have a complete answer to the question of
what happens when multiple traits in the same piece are listening to the
same keystroke.  Let me take a crack at answering this question based on
what I know so far:

Case 1) keystroke came from outside the piece.
In this case, all traits listening for the keystroke execute in order,
starting with the bottom of the trait list working backwards up to the
top, with the exception being trigger actions which are always executed
last (in presumably the same order--i.e. bottom to top).

Case 2) keystroke came from a trait within the piece.
Case 2a) keystroke came from a trigger
In this case, all traits listening for the keystroke execute in order,
starting from the one above the trigger working backwards to the top,
then the trigger sends its keystrokes and those are resolved, and then
all traits below the trigger are executed working backwards from the
bottom up to 1 below the trigger.
Case 2b) keystroke came from another trait, not a trigger (e.g. an
action button)
In this case, the traits are executed in the same order as Case 1.

Have I got it right yet?

P.S.  If you reply by clicking on the little icon on the top-right
corner of a post, your replies will be half the size.

_______________________________________________
Read this topic online here:
http://www.vassalengine.org/forum/viewtopic.php?p=19000#p19000


More information about the messages mailing list