Esempio n. 1
0
        public override bool Check()
        {
            var config = _configFactory.GetConfig();

            // Waypoint list is empty.
            if (!config.Route.IsPathSet)
            {
                return(false);
            }

            // Route belongs to a different zone.
            if (config.Route.Zone != fface.Player.Zone)
            {
                return(false);
            }

            // Has valid target to fight.
            if (UnitFilters.MobFilter(fface, CombatState.Target))
            {
                return(false);
            }

            // We don't have to rest.
            if (new RestState(fface).Check())
            {
                return(false);
            }

            // We don't have to heal.
            if (new HealingState(fface).Check())
            {
                return(false);
            }

            // We don't need to summon trusts
            if (new SummonTrustsState(fface).Check())
            {
                return(false);
            }

            // We are not bound or struck by an other movement
            // disabling condition.
            if (ProhibitEffects.ProhibitEffectsMovement
                .Intersect(fface.Player.StatusEffects).Any())
            {
                return(false);
            }

            return(true);
        }
        public virtual void Initialize(IConfigFactory <CosmosDbConfig> configFactory)
        {
            try
            {
                var config   = configFactory.GetConfig();
                var key      = config.MasterKey;
                var endpoint = config.Endpoint;
                DatabaseId          = config.DatabaseId;
                DefaultCollectionId = string.IsNullOrWhiteSpace(config.DefaultCollectionId) ? DatabaseId : config.DefaultCollectionId;

                Client = new DocumentClient(new Uri(endpoint), key, new ConnectionPolicy
                {
                    EnableEndpointDiscovery = false
                });
                Client.OpenAsync();

                CreateDatabaseIfNotExistsAsync().Wait();
                CreateCollectionIfNotExistsAsync(DefaultCollectionId).Wait();
            }
            catch (AggregateException ex)
            {
                TriggerCriticalExceptonEvent(ex.InnerException);
                throw;
            }
            catch (Exception ex)
            {
                TriggerCriticalExceptonEvent(ex);
                throw;
            }
        }
Esempio n. 3
0
 public AzureBlobService(IConfigFactory <AzureBlobConfig> configFactory)
 {
     _config = configFactory.GetConfig();
 }
 public SqlDataService(IConfigFactory <SqlDataServiceConfig> configFactory)
 {
     _config = configFactory.GetConfig();
 }
Esempio n. 5
0
        public TableStorageService(IConfigFactory <TableStorageServiceConfig> configFactory)
        {
            var config = configFactory.GetConfig();

            ChangeTable(config).Wait();
        }