private void StartListeningToGameState()
 {
     _statusSubscription = (from interval in Observable.Interval(TimeSpan.FromSeconds(1))
                            from gameStatus in GameServerClient.GetGameStatus(_gameId)
                            select gameStatus)
                           .Where(status => status != null)
                           .DistinctUntilChanged(status => status.Id)
                           .Subscribe(PassStatusToStateHandler);
 }
        public MultiplayerGame(string name, string gameId, GameRole role, GameServerClient gameServerClient, PlayerDto player)
        {
            _gameId           = gameId;
            _role             = role;
            _gameServerClient = gameServerClient;
            _player           = player;
            Name = name;

            Players = new ObservableCollection <PlayerDto>();

            TransitionToState(typeof(WaitingForPlayersState));
            StartListeningToGameState();
        }
示例#3
0
 public MultiplayerGameManager()
 {
     _client = new GameServerClient();
 }