public void addOrUpdateStat(eIntStat stat, int value) { sIntStat entry; if (intStats.TryGetValue(stat, out entry)) { entry.value = value; intStats[stat] = entry; } else { entry = new sIntStat(stat, value); intStats.Add(stat, entry); } }
void parseIntStats(StreamReader inputFile) { short amount = 0; int sectionHeader = Utils.readInt32(inputFile); if (sectionHeader >> 16 == 0x40) { amount = (short)sectionHeader; for (int i = 0; i < amount; i++) { sIntStat newStat = new sIntStat(inputFile); intStats.Add(newStat.key, newStat); } } }