Beispiel #1
0
 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");
 }
Beispiel #2
0
 public virtual void PutPieceAt(BoardPosition pos, Piece p)
 {
     PutPieceAt(pos.X, pos.Y, p);
 }
Beispiel #3
0
 public virtual void PutPiece(Piece p)
 {
     PutPieceAt(p.X, p.Y, p);
 }
Beispiel #4
0
 public virtual void MovePieceTo(Piece p, int newx, int newy)
 {
     RemovePiece(p);
     PutPieceAt(newx, newy, p);
 }
Beispiel #5
0
 public bool RemovePiece(Piece p)
 {
     return RemovePiece(p.X, p.Y);
 }
Beispiel #6
0
 public void Clear()
 {
     WhiteLog.Clear();
     BlackLog.Clear();
     BoardMatrix = new Piece[8,8];
 }