Get the board to print
This commit is contained in:
22
lib/goban.py
22
lib/goban.py
@ -258,6 +258,28 @@ class Goban:
|
||||
return num_deleted
|
||||
|
||||
|
||||
def draw_code(self, pos):
|
||||
if not self._on_board(pos):
|
||||
return None
|
||||
|
||||
point = self.board[pos]
|
||||
|
||||
if point == Goban.EMPTY:
|
||||
code = self.def_draw_codes[pos]
|
||||
elif point == Goban.BLACK:
|
||||
code = 'b'
|
||||
elif point == Goban.WHITE:
|
||||
code = 'w'
|
||||
|
||||
if pos == self.last_move:
|
||||
code = code + 'T'
|
||||
|
||||
if pos == self.ko:
|
||||
code = code + 'C'
|
||||
|
||||
return code
|
||||
|
||||
|
||||
|
||||
# def draw_board(self, size, img_res):
|
||||
# ret = pygame.Surface((size,size))
|
||||
|
Reference in New Issue
Block a user