2222
2323use board:: Board ;
2424use board:: Color ;
25- use board:: Coord ;
2625use board:: IllegalMove ;
2726use board:: Move ;
2827use board:: NoMove ;
@@ -47,7 +46,6 @@ pub trait Info {
4746pub struct Game {
4847 board : Board ,
4948 last_move : Move ,
50- move_number : u16 ,
5149 zobrist_hash_table : ZobristHashTable ,
5250}
5351
@@ -58,16 +56,14 @@ impl Game {
5856 Game {
5957 board : new_board,
6058 last_move : NoMove ,
61- move_number : 0 ,
6259 zobrist_hash_table : ZobristHashTable :: new ( size) ,
6360 }
6461 }
6562
66- pub fn with_new_state ( board : Board , move_number : u16 , zobrist_hash_table : ZobristHashTable , last_move : Move ) -> Game {
63+ pub fn with_new_state ( board : Board , zobrist_hash_table : ZobristHashTable , last_move : Move ) -> Game {
6764 Game {
6865 board : board,
6966 last_move : last_move,
70- move_number : move_number,
7167 zobrist_hash_table : zobrist_hash_table,
7268 }
7369 }
@@ -77,7 +73,7 @@ impl Game {
7773
7874 match new_board. play ( m) {
7975 Ok ( _) => {
80- let mut new_game_state = Game :: with_new_state ( new_board, self . move_number + 1 , self . zobrist_hash_table . clone ( ) , m) ;
76+ let mut new_game_state = Game :: with_new_state ( new_board, self . zobrist_hash_table . clone ( ) , m) ;
8177 if !m. is_pass ( ) && !m. is_resign ( ) {
8278 match new_game_state. check_and_update_super_ko ( & m) {
8379 Err ( _) => return Err ( IllegalMove :: SuperKo ) ,
@@ -94,20 +90,6 @@ impl Game {
9490 self . zobrist_hash_table . check_and_update_super_ko ( m, & self . board )
9591 }
9692
97- // Note: This method uses 1-1 as the origin point, not 0-0. 19-19 is a valid coordinate in a 19-sized board, while 0-0 is not.
98- // this is done because I think it makes more sense in the context of go. (Least surprise principle, etc...)
99- pub fn get ( & self , col : u8 , row : u8 ) -> Color {
100- self . board . color ( & Coord :: new ( col, row) )
101- }
102-
103- pub fn ruleset ( & self ) -> Ruleset {
104- self . board . ruleset ( )
105- }
106-
107- pub fn move_number ( & self ) -> u16 {
108- self . move_number
109- }
110-
11193 pub fn last_move ( & self ) -> Move {
11294 self . last_move
11395 }
@@ -136,24 +118,10 @@ impl Game {
136118 self . board . set_komi ( komi) ;
137119 }
138120
139- pub fn board_size ( & self ) -> u8 {
140- self . board . size ( )
141- }
142-
143121 pub fn board ( & self ) -> Board {
144122 self . board . clone ( )
145123 }
146124
147- pub fn show_chains ( & self ) {
148- for c in self . board . chains ( ) . iter ( ) {
149- println ! ( "{}" , c. show( ) ) ;
150- }
151- }
152-
153- pub fn next_player ( & self ) -> Color {
154- self . board . next_player ( )
155- }
156-
157125 pub fn legal_moves ( & self ) -> Vec < Move > {
158126 self . board
159127 . legal_moves_without_superko_check ( )
0 commit comments