public void RemoveModifier(int id, ResourceModifier resourceModifier) { Resource resource = getResourceByType(resourceModifier.ResourceType); resource.RemoveModifier(id, resourceModifier); resource.ApplyModifiers(); }
public void RemoveModifier(int id, ResourceModifier resourceModifier) { if (Modifiers.ContainsKey(id)) { Modifiers.Remove(id); } }
private void AddModifier(int id, ResourceModifier resourceModifier) { Resource resource = getResourceByType(resourceModifier.ResourceType); resource.AddModifier(id, resourceModifier); resource.ApplyModifiers(); }
public void AddModifier(int id, ResourceModifier resourceModifier) { if (resourceModifier.ResourceModifierType == ResourceModifierType.Amount) { Amount += resourceModifier; } else { if (!Modifiers.ContainsKey(id)) { Modifiers.Add(id, new List <ResourceModifier>()); } Modifiers[id].Add(resourceModifier); } }