OSDN Git Service

The game_name attribute has been moved to the super class, BasicPlayer.
authorbeatles <beatles@b8c68f68-1e22-0410-b08e-880e1f8202b4>
Sat, 26 Dec 2009 01:40:19 +0000 (01:40 +0000)
committerbeatles <beatles@b8c68f68-1e22-0410-b08e-880e1f8202b4>
Sat, 26 Dec 2009 01:40:19 +0000 (01:40 +0000)
In order to test cases using BasicPlayer class, it now requires the game_name attribute.

shogi_server/player.rb

index 7d5f91f..02b75f3 100644 (file)
@@ -31,6 +31,7 @@ class BasicPlayer
     @loss = 0
     @last_game_win = false
     @sente = nil
+    @game_name = ""
   end
 
   # Idetifier of the player in the rating system
@@ -60,6 +61,9 @@ class BasicPlayer
   # true for Sente; false for Gote
   attr_accessor :sente
 
+  # game name
+  attr_accessor :game_name
+
   def is_human?
     return [%r!_human$!, %r!_human@!].any? do |re|
       re.match(@name)
@@ -122,7 +126,6 @@ class Player < BasicPlayer
     @protocol = nil             # CSA or x1
     @eol = eol || "\m"          # favorite eol code
     @game = nil
-    @game_name = ""
     @mytime = 0                 # set in start method also
     @socket_buffer = []
     @main_thread = Thread::current
@@ -132,7 +135,7 @@ class Player < BasicPlayer
   end
 
   attr_accessor :socket, :status
-  attr_accessor :protocol, :eol, :game, :mytime, :game_name
+  attr_accessor :protocol, :eol, :game, :mytime
   attr_accessor :main_thread
   attr_reader :socket_buffer