Ejemplo n.º 1
0
        public LobbiesViewModel()
        {
            _proxy = new LobbyProxy();
            //_proxy.LobbyJoined += OnJoinLobby;
            _proxy.LobbyCreated += OnLobbyCreated;
            _proxy.LobbyUpdated += OnLobbyUpdated;
            // _proxy.GetLobbiesResponse += OnLobbiesRecieved;
            // _proxy.GetLobbyByIdResponse += OnLobbyRecieved;
            _proxy.LobbyDeleted    += OnLobbyDeleted;
            _proxy.LobbiesRecieved += OnLobbiesRecieved;

            ///
            // _lobbies = new ObservableCollection<LobbyServiceReference.Lobby>(_proxy.GetLobbies());
            //Lobbies = _lobbies;
            //_lobbies = new List<LobbyServiceReference.Lobby>();
            customPrincipal = Thread.CurrentPrincipal as CustomPrincipal;
            Mediator.Subscribe("LobbyCreated", new Action <object>((x) =>
            {
                App.Current.Dispatcher.Invoke((Action) delegate
                {
                    cld.Close();
                    //JoinLobby(x);
                });
            }));
            _proxy.GetLobbies();


            //RefreshLobbies();
        }
        public override void Execute(INotification notification)
        {
            base.Execute(notification);
            LobbyProxy lobbyProxy = Facade.RetrieveProxy(nameof(LobbyProxy)) as LobbyProxy;

            lobbyProxy.RequestRefreshRoomList();
        }
Ejemplo n.º 3
0
        public override void Execute(INotification notification)
        {
            base.Execute(notification);
            LobbyProxy lobbyProxy = Facade.RetrieveProxy(nameof(LobbyProxy)) as LobbyProxy;
            var        roomId     = notification.Body as string;

            lobbyProxy.RequestJoinRoom(roomId);
        }
        public override void Execute(INotification notification)
        {
            base.Execute(notification);
            LobbyProxy lobbyProxy = Facade.RetrieveProxy(nameof(LobbyProxy)) as LobbyProxy;
            var        tuple      = notification.Body as Tuple <string, string, string>;

            lobbyProxy.RequestCreateRoom(tuple.Item1, tuple.Item2, tuple.Item3);
        }
Ejemplo n.º 5
0
        public InputPasswordViewModel()
        {
            customPrincipal = Thread.CurrentPrincipal as CustomPrincipal;

            _proxy = new LobbyProxy();
            //_proxy.LobbyJoined += OnJoinLobby;
            //_proxy.GetLobbyByIdResponse += OnLobbyRecieved;
            //Mediator.Subscribe("SendLobbyId", SetLobby);
        }
        public LobbyViewModel()
        {
            Mediator.Subscribe("LobbyJoined", LobbyJoined);
            _proxy = new LobbyProxy();
            _proxy.LobbyUpdated += OnLobbyUpdated;
            _proxy.LobbyDeleted += OnLobbyDeleted;
            customPrincipal      = Thread.CurrentPrincipal as CustomPrincipal;
            Mediator.Subscribe("LeaveLobbyOnExit", LeaveLobby);


            //_joinLobbyCommand = new DelegateCommand(JoinLobby, CanJoin);
        }
 public CreateLobbyViewModel()
 {
     _proxy = new LobbyProxy();
     _proxy.LobbyCreated += OnLobbyCreated;
 }