public List <DBUPGRADE> GetRange(DBSTRINGCOLLECTION abilIDs) { List <DBUPGRADE> list = new List <DBUPGRADE>(this.Count); foreach (DBUPGRADE u in this) { if (abilIDs.Contains(u.codeID)) { list.Add(u); } } return(list); }
public static DBUPGRADE[] getUpgrades(IList <string> upgradeList) { DBSTRINGCOLLECTION dbc = new DBSTRINGCOLLECTION(upgradeList); ArrayList al = new ArrayList(); foreach (string upgradeID in dbc) { HabProperties hps = DHLOOKUP.hpcUpgradeData[upgradeID]; if (hps == null) { continue; } DBUPGRADE upgrade = new DBUPGRADE(hps); al.Add(upgrade); } return((DBUPGRADE[])al.ToArray(typeof(DBUPGRADE))); }
public bool Contains(DBSTRINGCOLLECTION codeIDs) { foreach (string codeID in codeIDs) { bool found = false; foreach (DBUPGRADE upgrade in this) { if (upgrade.codeID == codeID) { found = true; break; } } if (found == false) { return(false); } } return(true); }