private Step CreateValidMoveFromDragg(Point dropLocation) { Cell targetCell = GetCellFromLocation(dropLocation); if (targetCell == null) { return(null); } Piece piece = game.GetPieceByRowCol((draggSrcCell.Row, draggSrcCell.Col)); List <Step> stepOptions = new List <Step>(); game.StepOptions(piece, ref stepOptions); if (stepOptions.Count == 0) { return(null); } foreach (Step step in stepOptions) { if (step.DstCellRow == targetCell.Row && step.DstCellCol == targetCell.Col) { return(step); } } return(null); }