OSDN Git Service

- shogi_server/player.rb:
[shogi-server/shogi-server.git] / test / mock_player.rb
1 $:.unshift File.join(File.dirname(__FILE__), "..")
2 require 'shogi_server/player'
3
4 class MockPlayer < ShogiServer::BasicPlayer
5   attr_reader :out
6   attr_accessor :game, :status, :protocol
7   attr_accessor :game_name
8   attr_reader :socket_buffer
9
10   def initialize
11     @name     = "mock_player"
12     @out      = []
13     @game     = nil
14     @status   = nil
15     @protocol = nil
16     @game_name = "dummy_game_name"
17     @socket_buffer = []
18   end
19
20   def write_safe(str)
21     @out << str
22   end
23 end
24
25