private void StartLocalGame()
        {
            var levelAssetLocalName = _levelNames[_currentLevelIndex];

            var parameters = new GameSessionStartParameters
            {
                MatchesToWin   = 5,
                MatchTime      = _matchTimeSeconds,
                SessionName    = "Local Session",
                LevelAssetPath = GetFilePathFromLevelName(levelAssetLocalName),
                ProvidePlayerFigureController = ProvideFigureController
            };
            var gameSession = new GameSessionImp(parameters);

            for (var i = 0; i < _playerCount; i++)
            {
                gameSession.AddMember(MemberType.ActivePlayer);
            }
            for (var i = 0; i < _comPlayerCount; i++)
            {
                gameSession.AddMember(MemberType.Computer);
            }

            gameSession.StartMatch();
            _stateChangeInformation = StateChangeInformation.StateChange(typeof(WaitState), typeof(SlideTransition), gameSession);
        }
Exemplo n.º 2
0
 public void Deactivate()
 {
     lock (_sessionAccessLockObject)
     {
         IsActive     = false;
         _gameSession = null;
     }
 }
Exemplo n.º 3
0
        public void Activate(GameSessionStartParameters parameters)
        {
            if (IsActive)
            {
                return;
            }

            lock (_sessionAccessLockObject)
            {
                _gameSession = new GameSessionImp(parameters);
                IsActive     = true;
            }

            _executionThread = new Thread(OnUpdateSession);
            _executionThread.Start();
        }