Esempio n. 1
0
File: Scene.cs Progetto: CarimA/RPG
        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));
            }
        }
Esempio n. 2
0
File: Scene.cs Progetto: CarimA/RPG
        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));
            }
        }