public void Add(IGameInstances instance) { instance.Parent = this; if (Objects.FindIndex(v => v.name == instance.name) != -1) { throw new Exception($"Object with name {instance.name} already exists."); } else { if (instance.name == null) { instance.name = "Unnamed Object " + Objects.Count; } Objects.Add(instance); } }
public void Remove(IGameInstances instance) { Remove(instance.name); }