コード例 #1
0
        public static OcrService GetOcrService(IConfigurationService configurationService, Hydro74000Context context)
        {
            IGymRepository          gymRepository          = new GymRepository(context);
            IRaidRepository         raidRepository         = new RaidRepository(context);
            IFortSightingRepository fortSightingRepository = new FortSightingRepository(context);
            var localizationService = new LocalizationService();
            var gymService          = new GymService(gymRepository, fortSightingRepository, localizationService, configurationService);
            var raidbossService     = new RaidbossService();
            var fileWatcherService  = new FileWatcherService();
            var pokemonService      = new PokemonService(raidbossService, localizationService, fileWatcherService);
            var raidService         = new RaidService(raidRepository, gymService, pokemonService, raidbossService, localizationService);

            return(new OcrService(configurationService, gymService, pokemonService, raidService, localizationService));
        }
コード例 #2
0
        public async Task UpdateGymAsync(IGym gym)
        {
            var fortSightings = await FortSightingRepository.FindAll(e => e.FortId == gym.Id).Take(1).ToListAsync();

            //Yuck -- we only store unix time as an int in this table!
            int now = (int)DateTimeOffset.UtcNow.ToUnixTimeSeconds();

            if (fortSightings == null || fortSightings.Count == 0)
            {
                var fortSighting = FortSightingRepository.CreateInstance();
                fortSighting.FortId       = gym.Id;
                fortSighting.Team         = 0;
                fortSighting.LastModified = now;
                fortSighting.Updated      = now;
                FortSightingRepository.Add(fortSighting);
            }
            else
            {
                var fortSighting = fortSightings[0];
                fortSighting.LastModified = now;
                fortSighting.Updated      = now;
            }
            await FortSightingRepository.SaveAsync();
        }