Exemplo n.º 1
0
        private static void Bootstrap(Logger logger, AppBase app)
        {
            if (_current != null)
            {
                throw new InvalidOperationException("Failed to bootstrap the app. Thundershock is already running.");
            }

            // bind this thundershock app to this instance of thundershock.
            _current = app;
            logger.Log($"Bootstrapping \"{_current.GetType().Name}\"...");

            // Hand control off to the app.
            // We no longer need to worry about starting MonoGame - the app has COMPLETE control
            // over what it decides to use as a rendering system.
            app.Run(logger);

            // The above method blocks until MonoGame tears itself down successfully. If we get this far, we can unbind the app.
            _current = null;
            logger.Log("The boots were off and the straps are undone, the app is no longer being run.");
        }
Exemplo n.º 2
0
 public void Unload()
 {
     OnUnload();
     App = null;
 }
Exemplo n.º 3
0
        public void Initialize(AppBase app)
        {
            App = app ?? throw new ArgumentNullException(nameof(app));

            OnLoad();
        }