Exemplo n.º 1
0
        private static void Create_NewGame()
        {
            #region Prepare UI and get menu result

            ZConsoleMain.ClearScreen();
            Draw_Interface();
            Draw_Credits();
            var loadGameFileName = MainMenu();

            #endregion

            #region Create Galaxy, Player and all area handlers

            GameConfig.Reset();
            Galaxy = GalaxyModel.Create(GameConfig.CurrentGalaxySizeX, GameConfig.CurrentGalaxySizeY);
            Player = PlayerModel.Create();
            CurrentStarSystem.IsExplored = true;

            GalaxyMap	= new GalaxyMap(GalaxyArea, GameConfig.CurrentGalaxySizeX, GameConfig.CurrentGalaxySizeY);
            EventLog	= new EventLog(EventArea);
            ActionPanel	= new ActionPanel(ActionArea);
            PlayerStats = new PlayerStats(PlayerStatsArea);
            BattleStats	= new BattleStats(BattleStatsArea);
            EventLog.ClearArea();

            #endregion

            #region Load game or show Intro Text and get Player name

            if (!string.IsNullOrEmpty(loadGameFileName))
            {
                SaveLoad.LoadGame(loadGameFileName);
            }
            else
            {
                PrintIntroText();
                EventLog.Print("Common_EnterYourName");
                ZCursor.SetCursorVisibility(true);
                Player.Name = ZInput.ReadLine(2 + Lang["Common_EnterYourName"].Length, 7, 9, Color.Yellow, Color.Black, false, "Jameson");
                ZCursor.SetCursorVisibility(false);
            }

            #endregion

            #region Prepare UI, draw galaxy, etc.

            Draw_Controls(true);
            GlobalEvent.Create(Galaxy, CurrentStarSystem);
            ActionPanel.ClearArea();
            PlayerStats.Draw_PlayerStats();
            GalaxyMap.Draw_GalaxyMap();
            GalaxyMap.HighlightArea();
            EventLog.Print("Galaxy_ChooseSystem");

            #endregion
        }