Exemple #1
0
 public override bool CanEat(CheckersPiece piece)
 {
     if (piece==null) return false;
     BoardPosition[][] possiblePos = this.PossiblePaths;
     for(int i =0; i<IncMov.Length; i++)
     {
         BoardPosition p = new BoardPosition(piece.X+IncMov[i].X, piece.Y+IncMov[i].Y);
         if (this.ParentBoard.IsInsideBoard(p.X, p.Y) && this.ParentBoard.IsEmptyCell(p.X, p.Y) && CanMoveTo(p.X, p.Y, possiblePos)) return true;
     }
     return false;
 }
Exemple #2
0
 public override bool CanEat(CheckersPiece piece)
 {
     return false;
 }
Exemple #3
0
 /// <summary>
 /// When overriden on a derivated class should return if the give piece can be eaten by this piece or not 
 /// </summary>
 /// <param name="piece"></param>
 /// <returns></returns>
 public abstract bool CanEat(CheckersPiece piece);