JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
fixed (recently broken) mark/flip on client
authorJason Woofenden <jason@jasonwoof.com>
Thu, 3 Nov 2011 04:15:00 +0000 (00:15 -0400)
committerJason Woofenden <jason@jasonwoof.com>
Thu, 3 Nov 2011 04:15:00 +0000 (00:15 -0400)
client.coffee

index 56c665d..967917d 100644 (file)
@@ -264,23 +264,23 @@ init = ->
                if z > top_card_z
                        top_card_z = z
                update_pile_views() # ensures instantiation of all visible cards
-               if state.cards[card].view? # the card is visible
+               if @cards[card].view? # the card is visible
                        # show it face down if it's in the other player's hand
-                       state.cards[card].view.toggleClass 'your_hand', in_your_hand state.cards[card]
+                       @cards[card].view.toggleClass 'your_hand', in_your_hand @cards[card]
 
                if agent is me
                        tell_server ['move', agent, card, x, y, z, pile]
                else
-                       if state.cards[card].view?
-                               state.cards[card].view.css "z-index": z
-                               state.cards[card].view.animate { left: "#{transform_x x}px", top: "#{transform_y y}px"}, 800
+                       if @cards[card].view?
+                               @cards[card].view.css "z-index": z
+                               @cards[card].view.animate { left: "#{transform_x x}px", top: "#{transform_y y}px"}, 800
        state.on 'mark', (agent, card, state) ->
-               if state.cards[card].view?
+               if @cards[card].view?
                        @cards[card].view.toggleClass 'marked', state
                if agent is me
                        tell_server ['mark', agent, card, state]
        state.on 'flip', (agent, card, state) ->
-               if state.cards[card].view?
+               if @cards[card].view?
                        @cards[card].view.toggleClass 'flipped', state
                if agent is me
                        tell_server ['flip', agent, card, state]