fixed circular dependency
This commit is contained in:
parent
16d107e5ea
commit
55ba824b13
@ -1,6 +1,4 @@
|
|||||||
from logic.board import Board
|
|
||||||
from logic.position import Position
|
from logic.position import Position
|
||||||
from logic.move import Move
|
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
|
||||||
|
|
||||||
@ -9,7 +7,6 @@ class Colour(Enum):
|
|||||||
BLACK = "black"
|
BLACK = "black"
|
||||||
|
|
||||||
class Piece:
|
class Piece:
|
||||||
|
|
||||||
def __init__(self, pos: Position, colour: Colour) -> None:
|
def __init__(self, pos: Position, colour: Colour) -> None:
|
||||||
self.pos = pos
|
self.pos = pos
|
||||||
assert colour == Colour.WHITE or colour == Colour.BLACK, "The colour of the piece must be either Piece.WHITE or Piece.BLACK"
|
assert colour == Colour.WHITE or colour == Colour.BLACK, "The colour of the piece must be either Piece.WHITE or Piece.BLACK"
|
||||||
@ -18,5 +15,5 @@ class Piece:
|
|||||||
def position(self) -> Position:
|
def position(self) -> Position:
|
||||||
return self.pos
|
return self.pos
|
||||||
|
|
||||||
def legal_moves(self, board: Board) -> list[Move]:
|
def legal_moves(self, board: "Board") -> list["Move"]:
|
||||||
raise NotImplementedError(f"Can't say what the legal moves are for {type(self).__name__}, the method hasn't been implemented yet")
|
raise NotImplementedError(f"Can't say what the legal moves are for {type(self).__name__}, the method hasn't been implemented yet")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user