Esempio n. 1
0
 public ResetHandler(
     LevelState levelState,
     StateBroker stateBroker,
     EventBus eventBus,
     Board board) : base(levelState, stateBroker, eventBus)
 {
     _board = board;
 }
Esempio n. 2
0
 protected LevelStateHandler(
     LevelState levelState,
     StateBroker stateBroker,
     EventBus eventBus)
 {
     _levelState  = levelState;
     _stateBroker = stateBroker;
     _eventBus    = eventBus;
 }
        public void WhenRemovePropertyThatDoesNotExist_ThrowsException()
        {
            _stateBroker = new StateBroker();
            var stars = new ObservableStateProperty <int>(10);

            Assert.Throws <Exception>(() =>
            {
                _stateBroker.RemoveProperty(stars);
            });
        }
Esempio n. 4
0
 public FinishHandler(
     LevelState levelState,
     StateBroker stateBroker,
     EventBus eventBus,
     LevelSettings settings,
     SaveController saveController) : base(levelState, stateBroker, eventBus)
 {
     _settings       = settings;
     _saveController = saveController;
 }
        public void WhenAddSamePropertyTwice_ThrowsException()
        {
            _stateBroker = new StateBroker();
            var stars = new ObservableStateProperty <int>(10);

            _stateBroker.AddProperty(stars);

            Assert.Throws <Exception>(() =>
            {
                _stateBroker.AddProperty(stars);
            });
        }
        public void SetupStateBroker()
        {
            _stateBroker = new StateBroker();

            var stars = new ObservableStateProperty <int>(10);
            var coins = new ObservableStateProperty <int>(10);

            _stateBroker.AddProperty(stars);
            _stateBroker.AddProperty(coins);

            _state = new State(stars, coins);
        }
Esempio n. 7
0
 public StartHandler(
     LevelState levelState,
     StateBroker stateBroker,
     EventBus eventBus,
     Board board,
     LevelSettings settings,
     IActor player) : base(levelState, stateBroker, eventBus)
 {
     _board    = board;
     _settings = settings;
     _player   = player;
 }
        public void Setup()
        {
            _gameSettings = Resources.Load <GameSettings>("Settings/Game/GameSettings");
            _stateBroker  = Resources.Load <StateBroker>("Settings/Game/GameStateBroker");
            _gameState    = Resources.Load <GameState>("Settings/Game/GameState");

            _gameState.Initialise(_stateBroker);
            _stateBroker.Initialise();

            _sceneController = new SceneController(
                new MockSceneTransition(),
                _gameState,
                new MockEventBus()
                );
        }
Esempio n. 9
0
 public GameController(
     StateBroker stateBroker,
     EventBus gameEventBus,
     SceneController sceneController,
     GameSettings settings,
     GameState state,
     MonoBehaviour coroutineRunner)
 {
     _stateBroker     = stateBroker;
     _gameEventBus    = gameEventBus;
     _sceneController = sceneController;
     _settings        = settings;
     _state           = state;
     _coroutineRunner = coroutineRunner;
 }
Esempio n. 10
0
        private void Init()
        {
            if (StateBroker != null)
            {
                return;
            }

            StateBroker = new StateBroker();

            var stars = new ObservableStateProperty <int>(10);
            var coins = new ObservableStateProperty <int>(10);

            StateBroker.AddProperty(stars);
            StateBroker.AddProperty(coins);

            GameState = new GameState(stars, coins);
        }
Esempio n. 11
0
 public PauseHandler(LevelState levelState, StateBroker stateBroker, EventBus eventBus) : base(levelState, stateBroker, eventBus)
 {
 }