[Seaside] Design Question of a very small game

Jon Paynter kittle at mail.yans.net
Tue Oct 26 16:35:33 CEST 2004


---------- Original Message ----------------------------------
Date: Tue, 26 Oct 2004 13:15:52 +0200

>
>On Oct 22, 2004, at 4:27 PM, Jon Paynter wrote:
>
>> So in this case where you have a page with several hundred links (or 
>> in my case, a big semi-dynamic menu).... What is the pattern to use?
>
>I'm not sure what you mean; normally those hundreds of links would be 
>generated in a loop, and the lexical context (the block args in the 
>loop) would provide the information you need about exactly which link 
>was clicked.

I had something in mind where a menu task or something simmilar was called to do the actual routing once the component got input from the user.  I see now thats over complicating things.

.............

>> And as an afterthought -- the only time I DID try the task calls 
>> component pattern, I got wierd results.
>
>Can you elaborate?

I had the #go method in my task like this:

Task>>go

  [self isDone]
    whileFalse: [
      self rollinitiative.
      self player1Goes.
      self player2Goes.

      self checkPlayer.
      self checkNPC.
   ].

  "other stuff here"
  self halt.

-----------------------

In some cases, I would get stuck in a loop, in some cases the loop would terminate normally.. but I NEVER hit the halt outside that block.
I finally ended up taking the loop piece out and moving it to the component that calls this task, and things work properly now.  But there is still the feeling im missing something here.

All the methods in my #go method will #call other components to get input from the user -- if that makes any difference.

Jon.


More information about the Seaside mailing list