without class piece_moves
This commit is contained in:
parent
1a4c25911d
commit
9b1699d65b
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,11 +1,9 @@
|
||||
from piece import Piece
|
||||
from board import Board
|
||||
from square import Square
|
||||
|
||||
from abc import abstractmethod
|
||||
class Bishop(Piece):
|
||||
def __init__(self, color):
|
||||
super().__init__("bishop", color)
|
||||
|
||||
@abstractmethod
|
||||
def straightline_moves(self, piece, row, column, isvertical):
|
||||
if isvertical is True:
|
||||
self.direction = [
|
||||
|
5
king.py
5
king.py
@ -1,10 +1,9 @@
|
||||
from piece import Piece
|
||||
from board import Board
|
||||
from square import Square
|
||||
from abc import abstractmethod
|
||||
class King(Piece):
|
||||
def __init__(self, color):
|
||||
super().__init__("king", color)
|
||||
|
||||
@abstractmethod
|
||||
def king_moves(self, piece, row, column):
|
||||
self.direction = [
|
||||
(0, 1),
|
||||
|
@ -1,10 +1,9 @@
|
||||
from piece import Piece
|
||||
from board import Board
|
||||
from square import Square
|
||||
from abc import abstractmethod
|
||||
class Knight(Piece):
|
||||
def __init__(self, color):
|
||||
super().__init__("knight", color)
|
||||
|
||||
@abstractmethod
|
||||
def knight_moves(self, piece, row, column):
|
||||
self.possible_moves = [
|
||||
(row + 2, column - 1),
|
||||
|
6
move.py
6
move.py
@ -88,9 +88,9 @@ class Move:
|
||||
pass
|
||||
|
||||
def pawn_promotion(self, x, final_row, final_column):
|
||||
if isinstance(x, Pawn):
|
||||
if x.name == "pawn":
|
||||
if (final_row==0) or (final_row==7):
|
||||
self.board.boardlist[final_row][final_column].piece = Queen(x.color)
|
||||
x.name == "queen"
|
||||
def mat(self, x, final_row, final_column):
|
||||
if self.board.boardlist[final_row][final_column].has_piece():
|
||||
if self.board.boardlist[final_row][final_column].piece.name == 'king':
|
||||
@ -98,7 +98,7 @@ class Move:
|
||||
#print(x)
|
||||
#print(x.color)
|
||||
#print(self.board.boardlist[final_row][final_column].piece.color)
|
||||
self.board.boardlist[final_row][final_column].piece = x
|
||||
#self.board.boardlist[final_row][final_column].piece = x
|
||||
exit(0)
|
||||
@staticmethod
|
||||
def numbers_to_letters(number):
|
||||
|
4
pawn.py
4
pawn.py
@ -1,9 +1,9 @@
|
||||
from piece import Piece
|
||||
from board import Board
|
||||
from square import Square
|
||||
from abc import abstractmethod
|
||||
class Pawn(Piece):
|
||||
def __init__(self, color):
|
||||
super().__init__("pawn", color)
|
||||
@abstractmethod
|
||||
def pawn_moves(self, piece, row, column):
|
||||
if piece.moved == True:
|
||||
self.steps = 1
|
||||
|
5
queen.py
5
queen.py
@ -1,10 +1,9 @@
|
||||
from piece import Piece
|
||||
from board import Board
|
||||
from square import Square
|
||||
from abc import abstractmethod
|
||||
class Queen(Piece):
|
||||
def __init__(self, color):
|
||||
super().__init__("queen", color)
|
||||
|
||||
@abstractmethod
|
||||
def straightline_moves(self, piece, row, column, isvertical):
|
||||
if isvertical is True:
|
||||
self.direction = [
|
||||
|
5
rook.py
5
rook.py
@ -1,10 +1,9 @@
|
||||
from piece import Piece
|
||||
from board import Board
|
||||
from square import Square
|
||||
from abc import abstractmethod
|
||||
class Rook(Piece):
|
||||
def __init__(self, color):
|
||||
super().__init__("rook", color)
|
||||
|
||||
@abstractmethod
|
||||
def straightline_moves(self, piece, row, column, isvertical):
|
||||
if isvertical is True:
|
||||
self.direction = [
|
||||
|
Loading…
Reference in New Issue
Block a user