Exemplo n.º 1
0
        private void Construct(IGameStateUseCase gameStateUseCase, IEnclosureFactoryUseCase enclosureFactoryUseCase)
        {
            _interval = FieldParameter.INTERVAL * 4.0f;

            _gameStateUseCase        = gameStateUseCase;
            _enclosureFactoryUseCase = enclosureFactoryUseCase;
        }
Exemplo n.º 2
0
        public StateSequencer(IGameStateUseCase gameStateUseCase, ReadyView readyView, DrawView drawView,
                              AttackView attackView, DamageView damageView, ClearView clearView, FailView failView)
        {
            _states = new List <BaseState>
            {
                readyView,
                drawView,
                attackView,
                damageView,
                clearView,
                failView,
            };

            _disposable  = new CompositeDisposable();
            _tokenSource = new CancellationTokenSource();

            foreach (var state in _states)
            {
                state.InitAsync(_tokenSource.Token).Forget();
            }

            _gameStateUseCase = gameStateUseCase;
            _gameStateUseCase.GameState()
            .Subscribe(gameState =>
            {
                Reset(gameState);
                TickAsync(gameState, _tokenSource.Token).Forget();
            })
            .AddTo(_disposable);
        }
Exemplo n.º 3
0
        private void Construct(IGameStateUseCase gameStateUseCase)
        {
            _token            = this.GetCancellationTokenOnDestroy();
            _gameStateUseCase = gameStateUseCase;

            enclosureObjectView.Initialize(coreColor);
        }
Exemplo n.º 4
0
        public StatePresenter(IGameStateUseCase gameStateUseCase, InputState inputState, JudgeState judgeState,
                              ClearState clearState)
        {
            _disposable  = new CompositeDisposable();
            _tokenSource = new CancellationTokenSource();
            _states      = new List <BaseState>
            {
                inputState,
                judgeState,
                clearState,
            };
            _gameStateUseCase = gameStateUseCase;

            Init();

            _gameStateUseCase.gameState
            .Where(x => x != GameState.None)
            .Subscribe(state =>
            {
                //
                TickAsync(state, _tokenSource.Token).Forget();
            })
            .AddTo(_disposable);
        }
Exemplo n.º 5
0
 public PlayerController(IInputUseCase inputUseCase, IGameStateUseCase gameStateUseCase, CursorView cursorView)
 {
     _inputUseCase     = inputUseCase;
     _gameStateUseCase = gameStateUseCase;
     _cursorView       = cursorView;
 }