예제 #1
0
        protected async override Task <int> ExecuteInternalAsync()
        {
            string defaultProvider = DefaultProvider.Value();

            if (string.IsNullOrEmpty(defaultProvider) && UseDefault.HasValue())
            {
                defaultProvider = Settings.DefaultProvider;
            }
            await CreateManifestAsync(defaultProvider, DefaultDestination.Value(), Settings, DefaultProvider.LongName, CancellationToken.None);

            return(0);
        }
예제 #2
0
        public FlyTo(Dictionary <string, string> args)
            : base(args)
        {
            QBCLog.BehaviorLoggingContext = this;

            try
            {
                DefaultAllowedVariance = GetAttributeAsNullable <double>("AllowedVariance", false, new ConstrainTo.Domain <double>(0.0, 50.0), null)
                                         ?? 0.0;
                DefaultArrivalTolerance = GetAttributeAsNullable <double>("ArrivalTolerance", false, new ConstrainTo.Domain <double>(1.5, 30.0), new string[] { "Distance" })
                                          ?? 3;
                DefaultDestination     = GetAttributeAsNullable <Vector3>("", false, ConstrainAs.Vector3NonEmpty, null);
                DefaultDestinationName = GetAttributeAs <string>("DestName", false, ConstrainAs.StringNonEmpty, new[] { "Name" })
                                         ?? ((DefaultDestination != null) ? DefaultDestination.ToString() : string.Empty);
                IgnoreIndoors = GetAttributeAsNullable <bool>("IgnoreIndoors", false, null, null) ?? false;
                Land          = GetAttributeAsNullable <bool>("Land", false, null, null) ?? false;
                MinHeight     = GetAttributeAsNullable("MinHeight", false, new ConstrainTo.Domain <float>(0, 200),
                                                       null);

                // 'Destination choices' processing...
                PotentialDestinations =
                    HuntingGroundsType.GetOrCreate(Element,
                                                   "DestinationChoices",
                                                   DefaultDestination.HasValue
                                                    ? new WaypointType(DefaultDestination.Value, DefaultDestinationName, DefaultAllowedVariance, DefaultArrivalTolerance)
                                                    : null, DefaultArrivalTolerance);
                IsAttributeProblem |= PotentialDestinations.IsAttributeProblem;
            }

            catch (Exception except)
            {
                // Maintenance problems occur for a number of reasons.  The primary two are...
                // * Changes were made to the behavior, and boundary conditions weren't properly tested.
                // * The Honorbuddy core was changed, and the behavior wasn't adjusted for the new changes.
                // In any case, we pinpoint the source of the problem area here, and hopefully it
                // can be quickly resolved.
                QBCLog.Exception(except);
                IsAttributeProblem = true;
            }
        }
예제 #3
0
 protected override void Because_of()
 {
     _defaultResult = Mapper.Map <DefaultSource, DefaultDestination>(new DefaultSource());
     _nullResult    = Mapper.Map <NullSource, NullDestination>(new NullSource());
 }
예제 #4
0
 public extern static void SetDestination(IntPtr widget, DefaultDestination defaultDestination, IntPtr targets, int targetCount, DragActions actions);