Example #1
0
        public void OnParamOnline(MenuParamGameOnline menuParam)
        {
            string pseudo = "Player";

            if (playerType == PlayerType.Human)
            {
                pseudo = (menuParam.player as PlayerName).Pseudo;
            }
            else
            {
                //TODO Get param if AI
                throw new Exception("AI not supported yet");

                // TODO BASTIEN :corriger cette ligne voodoo
                //string pseudo = (menuParam.player1 as PlayerAI);

                // Create the player
                //player1 = new Client(playerType, pseudo);
            }

            new Thread(() =>
            {
                // Register clients to applicationManager
                ApplicationManager.Instance.JoinGameOnline(playerType, pseudo, battleType);
            })
            .Start();
        }
Example #2
0
        private void OnPlayAgainst(BattleType battleType)
        {
            this.battleType = battleType;

            MenuParamGameOnline paramGame = new MenuParamGameOnline(playerType);

            paramGame.OnParamGameOnlineEvent += OnParamOnline;

            pageTransitionControl.ShowPage(paramGame);
        }