Ejemplo n.º 1
0
        public LocalImagesController(AppData appData, LoggingService logger, LocalCardsService localCardsService)
        {
            _appData = appData;
            _logger  = logger;
            ViewModel.Configuration = appData.Configuration;

            LoadPacks();

            View.Closed += (s, e) => {
                localCardsService.InvalidateManifestCache();
                appData.Game.OnEncounterSetsChanged();
            };
        }
Ejemplo n.º 2
0
        public ChooseEncountersController(AppData appData, LoggingService loggingService, LocalCardsService localCardsService)
        {
            _appData = appData;
            _logger  = loggingService;
            foreach (var pack in appData.Configuration.Packs)
            {
                var cycle = GetCyle(pack);

                foreach (var encounterSet in pack.EncounterSets)
                {
                    var selectableEncounterSet = new SelectableEncounterSet(encounterSet)
                    {
                        IsSelected = appData.Game.EncounterSets.Any(x => x.Code == encounterSet.Code)
                    };

                    cycle.EncounterSets.Add(selectableEncounterSet);
                    _selectableEncounterSets.Add(selectableEncounterSet);
                }
            }

            var manifests = localCardsService.GetLocalPackManifests();

            if (!manifests.Any())
            {
                return;
            }

            var localCycle = new SelectableEncounterCycle();

            ViewModel.Cycles.Add(localCycle);
            foreach (var manifest in localCardsService.GetLocalPackManifests())
            {
                var selectableLocalPackManifest = new SelectableLocalPackManifest(manifest)
                {
                    IsSelected = _appData.Game.LocalPacks.Any(x => string.Equals(x, manifest.Name, StringComparison.InvariantCulture))
                };

                _selectableLocalPackManifests.Add(selectableLocalPackManifest);
                localCycle.EncounterSets.Add(selectableLocalPackManifest);
            }
        }