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.
8 require 'plugins/plugin'
9 require 'interaction/match'
10 require_bundle 'engines', 'engine'
12 class GNUShogiEngine < Engine
15 plugin :name => 'GNUShogi Engine Protocol',
16 :protocol => 'GNUShogi',
20 text = @serializer.serialize(data[:move], data[:old_state])
37 def extra_command(text)
38 if text =~ /^[0-9]*\. (\.\.\.) (\S+)/
39 move = @serializer.deserialize($2, @match.state)
41 @match.move(self, move)
51 def allow_undo?(player, manager)
52 # gnushogi waits when you tell it to undo
53 if @match.current_player == self
54 warn "Please wait until GNU Shogi moves before undoing."