/// <summary> /// Applies the resource change to the /// </summary> /// <param name="forest"></param> /// <param name="amount"></param> public virtual void Apply(Forest forest, int amount) { foreach (KeyValuePair <string, double> entry in Table) { if (entry.Value > 0) { forest.Entities[entry.Key].Amount -= entry.Value * amount; } else { forest.AddItem(entry.Key, entry.Value * amount); } } }