2023-06-08 16:02:55 +02:00
|
|
|
class Piece:
|
|
|
|
def __init__(self, name, color):
|
|
|
|
self.name = name
|
|
|
|
self.color = color
|
|
|
|
self.valid_moves = []
|
|
|
|
self.moved = False
|
|
|
|
if color == 'white':
|
|
|
|
self.pawn_direction = -1
|
|
|
|
else:
|
|
|
|
self.pawn_direction = 1
|
|
|
|
def add_moves(self, move):
|
|
|
|
self.valid_moves.append(move)
|
|
|
|
def delete_moves(self):
|
|
|
|
self.valid_moves = []
|
2023-06-15 16:22:32 +02:00
|
|
|
|
2023-06-13 16:17:23 +02:00
|
|
|
|