public virtual void PutPieceAt(int x, int y, Piece p) { if (IsInsideBoard(x, y)) { BoardMatrix[x, y] = p; p.X = x; p.Y = y; p.ParentBoard = this; } else throw new Exception("Out of the board"); }
public virtual void PutPieceAt(BoardPosition pos, Piece p) { PutPieceAt(pos.X, pos.Y, p); }
public virtual void PutPiece(Piece p) { PutPieceAt(p.X, p.Y, p); }
public virtual void MovePieceTo(Piece p, int newx, int newy) { RemovePiece(p); PutPieceAt(newx, newy, p); }
public bool RemovePiece(Piece p) { return RemovePiece(p.X, p.Y); }
public void Clear() { WhiteLog.Clear(); BlackLog.Clear(); BoardMatrix = new Piece[8,8]; }