public
Fork of scrooloose/chesticles
Description: A chess hax in ruby
Clone URL: git://github.com/halorgium/chesticles.git
now Piece#temporarily_move_to removes any piece from teh target square and 
readds it after
scrooloose (author)
Sat Mar 08 17:27:51 -0800 2008
commit  0e16385aa431dfeba99af70024d8845bff3dce83
tree    803cc6625f5c837ea3a5e29aa0a0badb703ea950
parent  92aa4cc61b34a3f1d2a299ecd45dbbcf1d4740f2
...
51
52
53
 
54
55
56
 
57
58
59
...
51
52
53
54
55
56
57
58
59
60
61
0
@@ -51,9 +51,11 @@ class Piece
0
 
0
   def temporarily_move_to(square, &block)
0
     old_square = @square
0
+ old_piece = board.pieces.delete(board.piece_for(square))
0
     @square = square
0
     to_return = block.call(self)
0
     @square = old_square
0
+ board.pieces << old_piece if old_piece
0
     to_return
0
   end
0
 

Comments

    No one has commented yet.