Ejemplo n.º 1
0
        public Move FindMove(int from, int to)
        {
            List <Move> moves = GetMovesForPosition(from);

            Move targetPosition = moves.FindTargetPosition(to);

            if (!MoveHelper.isValidMove(targetPosition))
            {
                throw new Exception("Move not found");
            }
            if (!IsLegalMove(targetPosition))
            {
                throw new Exception("Illegal move");
            }

            return(targetPosition);
        }