This commit is contained in:
cutsweettea
2025-10-29 10:36:33 -04:00
parent 45d60d1657
commit bbd55f48a0
10 changed files with 147 additions and 32 deletions

View File

@@ -28,8 +28,25 @@ class MoveValidity(Enum):
# TODO: create UndoException
class UndoException(Exception):
pass
# create default board setup (y, x) not (x, y)
# blank spaces are set to none, as seen in the chess_gui_small_view
DEFAULT_BOARD = [
[Rook(Player.BLACK), Knight(Player.BLACK), Bishop(Player.BLACK), Queen(Player.BLACK), King(Player.BLACK), Bishop(Player.BLACK), Knight(Player.BLACK), Rook(Player.BLACK)],
[Pawn(Player.BLACK), Pawn(Player.BLACK), Pawn(Player.BLACK), Pawn(Player.BLACK), Pawn(Player.BLACK), Pawn(Player.BLACK), Pawn(Player.BLACK), Pawn(Player.BLACK)],
[None, None, None, None, None, None, None, None],
[None, None, None, None, None, None, None, None],
[None, None, None, None, None, None, None, None],
[None, None, None, None, None, None, None, None],
[Pawn(Player.WHITE), Pawn(Player.WHITE), Pawn(Player.WHITE), Pawn(Player.WHITE), Pawn(Player.WHITE), Pawn(Player.WHITE), Pawn(Player.WHITE), Pawn(Player.WHITE)],
[Rook(Player.WHITE), Knight(Player.WHITE), Bishop(Player.WHITE), Queen(Player.WHITE), King(Player.WHITE), Bishop(Player.WHITE), Knight(Player.WHITE), Rook(Player.WHITE)]
]
class ChessModel:
# TODO: fill in this class
pass
def __init__(self):
self.__board = DEFAULT_BOARD
# i wanna do easy checking for whether a piece can skip over another piece