- while line != "# Start game":
- #print "Reading line " + str(line)
- self.line_number += 1
- [x,y] = map(int, line.split("at")[1].strip(" \r\n").split(","))
- colour = line.split(" ")[0]
- current_type = line.split(" ")[1]
- types = map(lambda e : e.strip(" [],'"), line.split(" ")[2:4])
- p = Piece(colour, x, y, types)
- if current_type != "unknown":
- p.current_type = current_type
- p.choice = types.index(current_type)
-
- self.board.pieces[colour].append(p)
- self.board.grid[x][y] = p
- if current_type == "king":
- self.board.king[colour] = p