From: Jason Woofenden Date: Thu, 3 Nov 2011 04:15:00 +0000 (-0400) Subject: fixed (recently broken) mark/flip on client X-Git-Url: https://jasonwoof.com/gitweb/?p=peach-cgt.git;a=commitdiff_plain;h=9f3c815c1cc9fa0b68771487362065bd8df9a17e fixed (recently broken) mark/flip on client --- diff --git a/client.coffee b/client.coffee index 56c665d..967917d 100644 --- a/client.coffee +++ b/client.coffee @@ -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]