more cool stuff
chess, woah
This commit is contained in:
35
chess/chess_model.py
Normal file
35
chess/chess_model.py
Normal file
@@ -0,0 +1,35 @@
|
||||
from enum import Enum
|
||||
from player import Player
|
||||
from move import Move
|
||||
from chess_piece import ChessPiece
|
||||
from pawn import Pawn
|
||||
from rook import Rook
|
||||
from knight import Knight
|
||||
from bishop import Bishop
|
||||
from queen import Queen
|
||||
from king import King
|
||||
from move import Move
|
||||
|
||||
class MoveValidity(Enum):
|
||||
Valid = 1
|
||||
Invalid = 2
|
||||
MovingIntoCheck = 3
|
||||
StayingInCheck = 4
|
||||
|
||||
def __str__(self):
|
||||
if self.value == 2:
|
||||
return 'Invalid move.'
|
||||
|
||||
if self.value == 3:
|
||||
return 'Invalid -- cannot move into check.'
|
||||
|
||||
if self.value == 4:
|
||||
return 'Invalid -- must move out of check.'
|
||||
|
||||
|
||||
# TODO: create UndoException
|
||||
|
||||
|
||||
class ChessModel:
|
||||
# TODO: fill in this class
|
||||
pass
|
||||
Reference in New Issue
Block a user