Ejemplo n.º 1
0
        public async Task LoadCached()
        {
            _hasStarted = true;
            if (!CacheExists)
            {
                throw new InvalidOperationException("Cache file doesn't exists!");
            }
            try
            {
                Data = await FactorioData.LoadFromCache(CachePath);

                _localizations = Data.Localizations ?? throw new ApplicationException("Cached data has no localization information!");
                OnLoadingCompleted();
            }
            catch (Exception e)
            {
                OnLoadingError(e.Message);
                _hasStarted = false;
            }
        }