private void InitializeWarscrolls() { //TODO: Inject Factory, Initialize upon creating new army or loading existing army // move path of resources to a army settings/configuration. var faction = new FactionExplorerModel { Name = "Stormcast Eternals" }; var factory = new StormcastEternalsFactory(); var warscrolls = factory.GetWarsrolls("resources/warscrolls/stormcast-warscrolls-settings-20190517125430.json"); var characters = new WarscrollExplorerModel { Role = "Characters", Warscrolls = new ObservableCollection <Warscroll>(warscrolls.Where(w => w.Role == UnitType.Leader || w.Role == UnitType.Unique)) }; var artillery = new WarscrollExplorerModel { Role = "Artillery", Warscrolls = new ObservableCollection <Warscroll>(warscrolls.Where(w => w.Role == UnitType.Artillery)) }; var units = new WarscrollExplorerModel { Role = "Units", Warscrolls = new ObservableCollection <Warscroll>(warscrolls.Where(w => w.Role == UnitType.Unit || w.Role == UnitType.Battleline)) }; faction.Warscrolls = new ObservableCollection <WarscrollExplorerModel>(new[] { characters, units, artillery }); Factions = new ObservableCollection <FactionExplorerModel>(new[] { faction }); }
public void GetWarscrolls_DeserializesSuccessfuly() { var factory = new StormcastEternalsFactory(); var dir = Directory.GetCurrentDirectory(); var warscrollsPath = "resources/warscrolls/stormcast-warscrolls-settings-20190517125430.json"; var warscrolls = factory.GetWarsrolls(warscrollsPath); Assert.NotEmpty(warscrolls); }