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; }
public override bool CanEat(CheckersPiece piece) { return false; }
/// <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);