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 GPSShogiEngine < Engine
15 plugin :name => 'GPSShogi Engine Protocol',
16 :protocol => 'GPSShogi',
20 text = @serializer.serialize(data[:move], data[:old_state])
34 def extra_command(text)
35 if text =~ /^[0-9]*\. (\.\.\.) (\S+)/
36 move = @serializer.deserialize($2, @match.state)
38 @match.move(self, move)
48 def allow_undo?(player, manager)
49 # gpsshogi does not wait when you tell it to undo
50 # so we stop it from playing before calling undo