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.
9 def execute_move(src, dst, opts = { })
10 state = match.history.state
11 move = policy.new_move(state, src, dst)
12 validate = match.game.validator.new(state)
19 def execute_drop(item, dst, opts = { })
20 state = match.history.state
21 move = policy.new_move(state, nil, dst,
22 :dropped => item.name)
23 validate = match.game.validator.new(state)
25 perform! move, opts.merge(:adjust => true, :dropped => item)
30 def execute_direct_drop(color, index, dst, opts = { })
31 state = match.history.state
32 item = @pools[color].items[index]
34 move = policy.new_move(state, nil, dst,
35 :dropped => item.name)
36 validate = match.game.validator.new(state)