Beispiel #1
0
        public void RegisterStartupSystem(Action <GameObjectList> method, int priority = 0)
        {
            var system = new StartupSystem(method, priority);

            if (system.RunOn == RunOn.Enter)
            {
                _enterSystems.Add(system);
            }
            else if (system.RunOn == RunOn.Exit)
            {
                _exitSystems.Add(system);
            }
            else
            {
                throw new ArgumentException("Method has an invalid RunOn value.", nameof(method));
            }
        }
Beispiel #2
0
        public void RegisterSystem(Action <GameTime, GameObjectList> method, int priority = 0)
        {
            var system = new System(method, priority);

            if (system.RunOn == RunOn.Update)
            {
                _updateSystems.Add(system);
            }
            else if (system.RunOn == RunOn.Draw)
            {
                _drawSystems.Add(system);
            }
            else
            {
                throw new ArgumentException("Method has an invalid RunOn value.", nameof(method));
            }
        }