OSDN Git Service

[shogi-server] - Implemented conversion of move representation between CSA format...
[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   attr_reader :rate
10
11   def initialize
12     @name     = "mock_player"
13     @out      = []
14     @game     = nil
15     @status   = nil
16     @protocol = nil
17     @game_name = "dummy_game_name"
18     @socket_buffer = []
19     @rate = 1500
20   end
21
22   def write_safe(str)
23     @out << str
24   end
25 end
26
27