1 # Copyright (c) 2009 Paolo Capriotti <p.capriotti@gmail.com>
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.
11 # Create a premover object
12 # executor: an object with execute_move and execute_direct_drop methods
13 # board: a graphical board
14 # pools: a hash of graphical pools
16 def initialize(executor, board, pools)
25 @executor.execute_move(@board.premove_src, @board.premove_dst)
27 @pools.each do |color, pool|
29 @executor.execute_direct_drop(color, pool.premove_src, @board.premove_dst)
38 def move(move_index, src, dst)
42 @board.premove(src, dst)
46 def drop(move_index, color, index, dst)
49 @board.premove_dst = dst
50 @pools[color].premove_src = index
55 @pools.each do |color, pool|
56 pool.premove_src = nil