public void AddComponent(componentEnum comp, int count) { for (int i = 0; i < components.Count; i++) { if (components[i].componentName == comp) { components[i].count += count; } } }
public bool AddComponentWithReturn(componentEnum comp, int count) { for (int i = 0; i < components.Count; i++) { if (components[i].componentName == comp) { components[i].count += count; return(true); } } return(false); }