Ejemplo n.º 1
0
        protected override void mapBindings()
        {
            base.mapBindings();


            _uiSignals    = injectionBinder.BindCrossContextSingletonSafely <UISignals>();
            _gameSignals  = injectionBinder.BindCrossContextSingletonSafely <GameSignals>();
            _inputSignals = injectionBinder.BindCrossContextSingletonSafely <InputSignals>();
            _srSignals    = injectionBinder.BindCrossContextSingletonSafely <SRSignals>();


            //Injection Bindings
            injectionBinder.Bind <IPoolModel>().To <PoolModel>().CrossContext().ToSingleton();
            injectionBinder.Bind <IGameModel>().To <GameModel>().CrossContext().ToSingleton();
            injectionBinder.Bind <ILevelModel>().To <LevelModel>().CrossContext().ToSingleton();
            injectionBinder.Bind <IPlayerModel>().To <PlayerModel>().CrossContext().ToSingleton();
            injectionBinder.Bind <IInputModel>().To <InputModel>().CrossContext().ToSingleton();
            injectionBinder.Bind <ProjectSROptions>().ToSingleton().CrossContext();


            //Mediation Bindings
            mediationBinder.BindView <PlayerView>().ToMediator <PlayerMediator>();
            mediationBinder.BindView <EnemyView>().ToMediator <EnemyMediator>();
            mediationBinder.BindView <BulletView>().ToMediator <BulletMediator>();
            mediationBinder.BindView <InputView>().ToMediator <InputMediator>();
            mediationBinder.BindView <CameraView>().ToMediator <CameraMediator>();
            mediationBinder.BindView <LevelManager>().ToMediator <LevelMediator>();

            //Command Bindings

            //In-Game
            commandBinder.Bind(_gameSignals.onDequeuePoolObject).To <OnDequeuePoolObjectCommand>();
            commandBinder.Bind(_gameSignals.onEnqueuePooledObject).To <OnEnqueuePooledObjectCommand>();

            //Level Behaviour
            commandBinder.Bind(_gameSignals.onLevelInitialize).InSequence()
            .To <OnLoadCurrentLevelCommand>()
            .To <OnNavMeshSceneBakeCommand>()
            .To <OnGetInputDataCommand>()
            .To <OnGetPlayerDataCommand>()
            .To <OnGetEnemyDataCommand>()
            .To <OnSetCinemachineTargetCommand>()
            .To <OnStartCountdownCommand>();

            commandBinder.Bind(_gameSignals.onLevelStart).InSequence()
            .To <OnActivateNavMeshAgentsCommand>()
            .To <OnActivatePlayerMovementCommand>()
            .To <OnActivateTouchCommand>();

            commandBinder.Bind(_gameSignals.onBulletHit).To <OnBulletHitCommand>();

            commandBinder.Bind(_gameSignals.onActivateLevelEndPanel).To <OnActivateLevelEndPanelCommand>();

            //Game Initalizer
            commandBinder.Bind(_gameSignals.onGameInitialize).InSequence()
            .To <OnSRDebuggerInitializerFixCommand>()
            .To <OnPoolingInitializer>()
            .To <OnSROptionsInjectionCommand>()
            .To <OnLevelInitializerCommand>();
        }
Ejemplo n.º 2
0
 public override void _Ready()
 {
     this.Connect("about_to_show", this, nameof(OnPopup));
     _gameSignals = (GameSignals)GetNode("/root/GameSignals");
     _gameSignals.Connect(nameof(GameSignals.UpdateUI), this, nameof(UpdateUI));
     _stringProvider = (StringProvider)GetNode("/root/StringProvider");
     _gameController = (GameController)GetNode("/root/GameController");
 }
Ejemplo n.º 3
0
 public override void _Ready()
 {
     _nextTurn       = (Button)GetNode(NextTurnPath);
     _gameController = (GameController)GetNode("/root/GameController");
     _gameSignals    = (GameSignals)GetNode("/root/GameSignals");
     _yearLabel      = (Label)GetNode("ToolBarContainer/VBoxContainer/year_label");
     //_gameSignals.Connect(nameof(GameSignals.UpdateUI), this, nameof(UpdateElement));
     _gameSignals.Connect(nameof(GameSignals.YearChanged), this, nameof(UpdateElement));
     _stringProvider = (StringProvider)GetNode("/root/StringProvider");
 }
Ejemplo n.º 4
0
        public override void _Ready()
        {
            _gameController = (GameController)GetNode("/root/GameController");
            //_currentBarony = (Barony)GetNode(baronyPath);
            _gameSignals = (GameSignals)GetNode("/root/GameSignals");
            _textureRect = (TextureRect)GetNode("TextureRect");
            Texture texture = (Texture)ResourceLoader.Load(_imageFile);

            _textureRect.Texture = texture;
            _label = (Label)GetNode("Label");
            this._gameSignals.Connect(nameof(GameSignals.UpdateUI), this, nameof(UpdateElement));
            _gameSignals.Connect(nameof(GameSignals.CurrentBaronyChanged), this, nameof(UpdateCurrentBarony));
        }