public IGameComponent AddComponent(IGameComponent component) { if (HasComponent(component)) throw new InvalidOperationException("Cannot add the same component more than once."); Components.Add(component); component.Enable(); return component; // var comp = someState.AddComponent(new SomeComponent()); }
public IGameComponent AddComponent(IGameComponent component) { if (HasComponent(component)) { throw new InvalidOperationException("Cannot add the same component more than once."); } Components.Add(component); component.Enable(); return(component); // var comp = someState.AddComponent(new SomeComponent()); }