예제 #1
0
        public static void Main()
        {
#if !DEBUG
            try
#endif
            {
                UIHelper.SetupUI();
                WelcomeWindow welcomeWindow = new WelcomeWindow();
                WelcomeWindow.Result result = welcomeWindow.Run();

                if (result.Quitting || TCODConsole.isWindowClosed())
                    return;

                using (GameInstance inst = new GameInstance())
                {
                    if (result.LoadCharacter)
                        inst.StartGameFromFile(result.CharacterName);
                    else
                        inst.StartNewGame(result.CharacterName);
                }
            }
            
            // In debug builds, we want the exception to be rethrown to make debugging easier. In release builds, we want it to get written to a file.
#if !DEBUG
            catch (System.Exception e)
            {
                using (TextWriter tw = new StreamWriter("DebuggingLog.txt"))
                {
                    tw.WriteLine("Message - " + e.Message);
                    tw.WriteLine("Source - " + e.Source);
                    tw.WriteLine("StackTrace - " + e.StackTrace);
                    tw.WriteLine("TargetSite - " + e.TargetSite);
                }
            }
#endif
        }
예제 #2
0
 internal AutoTraveler(IGameEngine engine, GameInstance instance)
 {
     m_engine = engine;
     m_gameInstance = instance;
 }
예제 #3
0
 public PlayerActions(IGameEngine engine, GameInstance instance)
 {
     m_engine = engine;
     m_gameInstance = instance;
     m_autoTraveler = new AutoTraveler(engine, instance);
 }