public void AddSourceCount(SourceCount sourceCount) { SourceCount tempSourceCount = GetSourceCount(sourceCount.VegetationSourceID); if (tempSourceCount == null) { tempSourceCount = new SourceCount { VegetationSourceID = sourceCount.VegetationSourceID }; SourceCountList.Add(tempSourceCount); } tempSourceCount.Count += sourceCount.Count; }
void IncreaseSourceCount(byte vegetationSourceID) { SourceCount sourceCount = GetSourceCount(vegetationSourceID); if (sourceCount == null) { sourceCount = new SourceCount { VegetationSourceID = vegetationSourceID }; SourceCountList.Add(sourceCount); } sourceCount.Count++; }
void DecreaseSourceCount(byte vegetationSourceID) { SourceCount sourceCount = GetSourceCount(vegetationSourceID); if (sourceCount == null) { return; } sourceCount.Count--; if (sourceCount.Count == 0) { SourceCountList.Remove(sourceCount); } }