Sharpcraft.Sharpcraft.Initialize C# (CSharp) Method

Initialize() protected method

Allows the game to perform any initialization it needs to before starting to run. This is where it can query for any required services and load any non-graphic related content. Calling base.Initialize will enumerate through any components and initialize them as well.
protected Initialize ( ) : void
return void
        protected override void Initialize()
        {
            _log.Debug("Initialize();");
            _log.Info("Sharpcraft is initializing!");

            base.Initialize();

            /* /!\ Steam hardcore loading action /!\ */
            _log.Info("Loading Steam components...");
            if (SteamManager.Init())
            {
                //SteamManager.FriendList.LoadFriends(); // Should load automatically now
                //Application.EnableVisualStyles();
                _log.Info("Creating Steam GUI.");
                // TODO: Find a way to set the start location of SteamGUI to be next to Game Window.
                var steamGUI = new SteamGUI();
                if (!steamGUI.Visible)
                    steamGUI.Show();
                _log.Info("Steam components loaded!");
            }
            else
            {
                _log.Info("Steam not installed or not running, Steam functionality will NOT be available.");
            }

            // /!\ WARNING /!\
            // Ugly debug code ahead!
            _log.Debug("Starting debug connection...");
            _server = new Server("F16Gaming Test", "localhost", 25565, "The test server", 0, 0, 0, true);
            Client = new Client(_server, new Player(0, "Sharpcraft"));
            Client.Connect();
            _log.Debug("Reached end of debug connection!");

            Exiting += (s, e) => Client.Exit();
        }