Exemple #1
0
 protected GameViewBase(ILog log, FontTarget font = FontTarget.Interface)
     : base(
         log,
         FontProvider.GetScreenWidth(font),
         FontProvider.GetScreenHeight(font),
         FontProvider.GetFont(font))
 {
 }
Exemple #2
0
        internal static void Main()
        {
            try
            {
                GameConfigurator.Configure();

                log = LogManager.GetLog(nameof(Program));

                var gameWidth  = FontProvider.GetScreenWidth(FontTarget.Game);
                var gameHeight = FontProvider.GetScreenHeight(FontTarget.Game) / 2;
                SadConsole.Game.Create(gameWidth, gameHeight);

                SadConsole.Game.OnInitialize = Init;

                SadConsole.Game.Instance.Run();

                SadConsole.Game.Instance.Dispose();

                log.Info("Closing game");

                CurrentGame.Load(null);

                GC.Collect();

                //throw new GameExitException();
            }
            catch (GameExitException)
            {
                throw;
            }
            catch (Exception e)
            {
                log.Fatal(e);
                throw;
            }
        }