Пример #1
0
        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());
        }
Пример #2
0
        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());
        }