Ejemplo n.º 1
0
        void Init()
        {
            ShowNames("", "", "", -1, 0);
            ShowPoints(-1);

            GamePageVM.IsYesNoPanelVisible = false;
            GamePageVM.IsButtonGoVisible   = false;
            ShowText("");
            ShowPoints(-1);
            ShowNameLabels(false);

            ReadFromRegistry();
            if (string.IsNullOrEmpty(UserName))
            {
                UserName = "******";
            }
            StartUpPageVM.PlayerName     = UserName;
            StartUpPageVM.ShowOnlineGame = !HideOnlineGameButton;
            if (string.IsNullOrEmpty(ServerIp))
            {
                ServerIp = "klons.id.lv";
            }
            if (string.IsNullOrEmpty(ServerPort))
            {
                ServerPort = "7777";
            }

            var gameformwrapped = GameFormWrapper.GetGUIWrapper(this);

            AppClient = new AppClient(gameformwrapped);

            ToGame   = (AppClient as IClient).FromGameUI;
            ToClient = (AppClient as IClient).FromClientUI;

            StartGame();

            MainWindow.Content = PageStartUp;
        }