public void testInit() { EdataManager dataManager = new EdataManager(NDF_PATH); dataManager.ParseEdataFile(); NdfbinManager everything = dataManager.ReadNdfbin(EVERYTHING_NDFBIN); List <NdfObject> unitInstances = everything.GetClass("TUniteAuSolDescriptor").Instances; // setup localisation/unites.dic reader EdataManager dataManager2 = new EdataManager(ZZ_PATH); dataManager2.ParseEdataFile(); TradManager dict = dataManager2.ReadDictionary(UNITES_DIC); // unit icons EdataManager zz4File = new EdataManager(ZZ4_PATH); zz4File.ParseEdataFile(); EdataManager iconPackage = zz4File.ReadPackage(ICON_PACKAGE); UnitDatabase unitDatabase = new UnitDatabase(unitInstances, dict, iconPackage, PACT_ICONS_DIRPREFIX, NATO_ICONS_DIRPREFIX); List <String> countries = unitDatabase.getAllCountries(); CollectionAssert.AllItemsAreUnique(countries); Assert.IsTrue(countries.Count > 0); }
public Form1(UnitDatabase unitDatabase, bool checkUpdates) { this.unitDatabase = unitDatabase; InitializeComponent(); countrySelect.DataSource = unitDatabase.getAllCountries(); List <String> categories = new List <String>(unitDatabase.categories); categories.Sort(); categories.Insert(0, ALL); categorySelect.DataSource = categories; autoUpdate = checkUpdates; }
public Form1(String defaultGameVersion, List <String> gameVersions, bool checkUpdates) { unitDatabase = UnitDatabasePool.getUnitDatabasePool().getUnitDatabase(this, defaultGameVersion); InitializeComponent(); versionDropdown.DataSource = gameVersions; versionDropdown.SelectedItem = defaultGameVersion; countrySelect.DataSource = unitDatabase.getAllCountries(); List <String> categories = new List <String>(unitDatabase.categories); categories.Sort(); categories.Insert(0, ALL); categorySelect.DataSource = categories; autoUpdate = checkUpdates; // Manually register these handlers beause their execution order is important unitList.SelectedIndexChanged += unitList_SelectedIndexChanged; weaponDropdownSimple.SelectedIndexChanged += weaponDropdownSimple_SelectedIndexChanged; weaponDropdown.SelectedIndexChanged += weaponDropdown_SelectedIndexChanged; customQueryInput.TextChanged += customQueryInput_TextChanged; }