Szachy/piece.py
Agata Halik 2b7004ad34 initial
2023-06-08 16:02:55 +02:00

19 lines
483 B
Python

class Piece:
def __init__(self, name, color):
self.name = name
self.color = color
self.valid_moves = []
self.moved = False
# kierunek pionkow, czarne w górę, białe w dół
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 = []