Пример #1
0
        public void CreateGamePostExecute(object context)
        {
            //change player screeen
            //player.inWaitingRoom = true
            string[] parameters = ((IEnumerable)context)
                                  .Cast <object>().Select(x => x.ToString()).ToArray();


            Player.IsHost        = true;
            Player.InWaitingRoom = true;
            Player.GameId        = Int32.Parse(parameters[3]);

            var waitingRoomWindow = new WaitingRoom()
            {
                ID         = Player.GameId,
                MinPlayers = Convert.ToInt32(parameters[0]),
                MaxPlayers = Convert.ToInt32(parameters[1]),
                GameName   = parameters[2],
                StartGame  = StartGame
            };

            Subscribe(waitingRoomWindow);   //newly made waiting room will subscribe to the client

            waitingRoomWindow.ShowDialog();
        }
Пример #2
0
        public void JoinGamePostExecute(object context)
        {
            GameInfo parameter = (GameInfo)context;

            Player.GameId        = parameter.gameId;
            Player.IsHost        = false;
            Player.InWaitingRoom = true;

            var waitingRoomWindow = new WaitingRoom()
            {
                ID         = parameter.gameId,
                MinPlayers = parameter.MinPlayers,
                MaxPlayers = parameter.MaxPlayers,
                GameName   = parameter.GameName,
                StartGame  = StartGame
            };

            Subscribe(waitingRoomWindow);   //newly made waiting room will subscribe to the client

            waitingRoomWindow.ShowDialog();
        }