protected void GenerateOrganicCompound() { int amountToAdd = Globals.RollD100(); OrganicResourceTypes resourceType = GetRandomOrganicResourceType(); bool found = false; foreach (OrganicCompound organicCompound in OrganicCompounds) { if (organicCompound.OrganicResourceType == resourceType) { found = true; organicCompound.Abundance += amountToAdd; } } if (!found) { OrganicCompounds.Add(new OrganicCompound(resourceType, amountToAdd)); } }
public OrganicCompound(OrganicResourceTypes organicResourceType, int abundance) { OrganicResourceType = organicResourceType; Abundance = abundance; }