public void InjectDependencies(
     List <CivilizationDisplayBase> civilizationDisplays, CoreSignals coreSignals,
     IGameCore gameCore, UIStateMachineBrain brain, CitySummaryManager citySummaryManager,
     IPossessionRelationship <IHexCell, ICity> cityLocationCanon, ITechCanon techCanon,
     IExplorationCanon explorationCanon, VisibilitySignals visibilitySignals,
     IFreeGreatPeopleCanon freeGreatPeopleCanon, ICameraFocuser cameraFocuser,
     [Inject(Id = "Free Techs Display")] RectTransform freeTechsDisplay,
     [Inject(Id = "Play Mode Default Panels")] List <RectTransform> defaultPanels,
     [Inject(Id = "Free Great People Notification")] RectTransform freeGreatPeopleNotification
     )
 {
     CivilizationDisplays = civilizationDisplays;
     CoreSignals          = coreSignals;
     GameCore             = gameCore;
     Brain = brain;
     CitySummaryManager          = citySummaryManager;
     CityLocationCanon           = cityLocationCanon;
     TechCanon                   = techCanon;
     ExplorationCanon            = explorationCanon;
     VisibilitySignals           = visibilitySignals;
     FreeGreatPeopleCanon        = freeGreatPeopleCanon;
     CameraFocuser               = cameraFocuser;
     FreeTechsDisplay            = freeTechsDisplay;
     DefaultPanels               = defaultPanels;
     FreeGreatPeopleNotification = freeGreatPeopleNotification;
 }
        public VisibilityResponder(
            IPossessionRelationship <ICivilization, IUnit> unitPossessionCanon,
            IPossessionRelationship <ICivilization, ICity> cityPossessionCanon,
            IVisibilityCanon visibilityCanon, IExplorationCanon explorationCanon,
            ICityLineOfSightLogic cityLineOfSightLogic,
            IUnitVisibilityLogic unitLineOfSightLogic,
            IUnitFactory unitFactory,
            ICityFactory cityFactory,
            IHexGrid grid,
            [Inject(Id = "Coroutine Invoker")] MonoBehaviour coroutineInvoker,
            IHexCellShaderData hexCellShaderData,
            UnitSignals unitSignals,
            CitySignals citySignals,
            HexCellSignals cellSignals,
            CivilizationSignals civSignals,
            VisibilitySignals visibilitySignals,
            CoreSignals coreSignals,
            MapRenderingSignals mapRenderingSignals
            )
        {
            UnitPossessionCanon  = unitPossessionCanon;
            CityPossessionCanon  = cityPossessionCanon;
            VisibilityCanon      = visibilityCanon;
            ExplorationCanon     = explorationCanon;
            CityLineOfSightLogic = cityLineOfSightLogic;
            UnitLineOfSightLogic = unitLineOfSightLogic;
            UnitFactory          = unitFactory;
            CityFactory          = cityFactory;
            Grid              = grid;
            CoroutineInvoker  = coroutineInvoker;
            HexCellShaderData = hexCellShaderData;

            unitSignals.LeftLocation.Subscribe(OnUnitLeftLocation);
            unitSignals.EnteredLocation.Subscribe(OnUnitEnteredLocation);

            citySignals.LostCellFromBoundaries.Subscribe(OnCityLostCell);
            citySignals.GainedCellToBoundaries.Subscribe(OnCityGainedCell);

            cellSignals.TerrainChanged.Subscribe(data => TryResetCellVisibility());
            cellSignals.ShapeChanged.Subscribe(data => TryResetCellVisibility());
            cellSignals.VegetationChanged.Subscribe(data => TryResetCellVisibility());

            civSignals.CivLosingCity.Subscribe(OnCivLosingCity);
            civSignals.CivGainedCity.Subscribe(OnCivGainedCity);
            civSignals.CivDiscoveredTech.Subscribe(data => TryResetResourceVisibility());
            civSignals.CivUndiscoveredTech.Subscribe(data => TryResetResourceVisibility());

            visibilitySignals.CellVisibilityModeChanged.Subscribe(unit => TryResetCellVisibility());
            visibilitySignals.CellExplorationModeChanged.Subscribe(unit => TryResetCellVisibility());
            visibilitySignals.ResourceVisibilityModeChanged.Subscribe(unit => TryResetResourceVisibility());

            coreSignals.ActivePlayerChanged.Subscribe(OnActivePlayerChanged);

            mapRenderingSignals.MapFinishedLoading.Subscribe(Unit => TryResetCellVisibility());
            mapRenderingSignals.MapFinishedLoading.Subscribe(Unit => TryResetResourceVisibility());
        }
Esempio n. 3
0
        public void CommonInstall()
        {
            MockUnitConfig = new Mock <IUnitConfig>();
            CoreSignals    = new CoreSignals();

            Container.Bind <IUnitConfig>().FromInstance(MockUnitConfig.Object);
            Container.Bind <CoreSignals>().FromInstance(CoreSignals);

            Container.Bind <UnitFortificationLogic>().AsSingle();
        }
        public void CommonInstall()
        {
            RoundExecuters.Clear();

            MockDiplomacyCore = new Mock <IDiplomacyCore>();
            CoreSignals       = new CoreSignals();

            Container.Bind <IDiplomacyCore>      ().FromInstance(MockDiplomacyCore.Object);
            Container.Bind <CoreSignals>         ().FromInstance(CoreSignals);
            Container.Bind <List <IRoundExecuter> >().FromInstance(RoundExecuters);

            Container.Bind <RoundExecutionSequencer>().AsSingle();
        }
        public CityProductionResolver(
            CitySignals citySignals, IPossessionRelationship <ICivilization, ICity> cityPossessionCanon,
            ICityFactory cityFactory, IBuildingProductionValidityLogic buildingValidityLogic,
            CoreSignals coreSignals
            )
        {
            CitySignals           = citySignals;
            CityPossessionCanon   = cityPossessionCanon;
            CityFactory           = cityFactory;
            BuildingValidityLogic = buildingValidityLogic;

            CitySignals.GainedBuilding.Subscribe(OnCityGainedBuilding);
            coreSignals.RoundBegan.Subscribe(OnRoundBegan);
        }
Esempio n. 6
0
        public void CommonInstall()
        {
            AllResourceNodes.Clear();
            AllPlayers.Clear();

            MockPlayerFactory = new Mock <IPlayerFactory>();
            CoreSignals       = new CoreSignals();
            PlayerSignals     = new PlayerSignals();

            MockPlayerFactory.Setup(factory => factory.AllPlayers).Returns(AllPlayers.AsReadOnly());

            Container.Bind <IPlayerFactory>().FromInstance(MockPlayerFactory.Object);
            Container.Bind <CoreSignals>   ().FromInstance(CoreSignals);
            Container.Bind <PlayerSignals> ().FromInstance(PlayerSignals);

            Container.Bind <GameCore>().AsSingle();
        }
Esempio n. 7
0
        public UIStateMachineBrain(
            [Inject(Id = "UI Animator")] Animator animator, CompositeCitySignals compositeCitySignals,
            CompositeUnitSignals compositeUnitSignals, PlayerSignals playerSignals, IGameCamera gameCamera,
            DescriptionTooltip descriptionTooltip, CellHoverDisplay cellHoverDisplay,
            CivilizationSignals civSignals, CoreSignals coreSignals, UnitSignals unitSignals
            )
        {
            Animator             = animator;
            CompositeCitySignals = compositeCitySignals;
            CompositeUnitSignals = compositeUnitSignals;
            PlayerSignals        = playerSignals;
            GameCamera           = gameCamera;
            DescriptionTooltip   = descriptionTooltip;
            CellHoverDisplay     = cellHoverDisplay;
            CivSignals           = civSignals;
            UnitSignals          = unitSignals;

            coreSignals.TurnBegan.Subscribe(OnTurnBegan);
        }
        public void CommonInstall()
        {
            AllCities.Clear();

            CitySignals                         = new CitySignals();
            MockCityPossessionCanon             = new Mock <IPossessionRelationship <ICivilization, ICity> >();
            MockCityFactory                     = new Mock <ICityFactory>();
            MockBuildingProductionValidityLogic = new Mock <IBuildingProductionValidityLogic>();
            CoreSignals                         = new CoreSignals();

            MockCityFactory.Setup(factory => factory.AllCities).Returns(AllCities.AsReadOnly());

            Container.Bind <CitySignals>                                  ().FromInstance(CitySignals);
            Container.Bind <IPossessionRelationship <ICivilization, ICity> >().FromInstance(MockCityPossessionCanon.Object);
            Container.Bind <ICityFactory>                                 ().FromInstance(MockCityFactory.Object);
            Container.Bind <IBuildingProductionValidityLogic>             ().FromInstance(MockBuildingProductionValidityLogic.Object);
            Container.Bind <CoreSignals>                                  ().FromInstance(CoreSignals);

            Container.Bind <CityProductionResolver>().AsSingle();
        }
Esempio n. 9
0
        public UnitFortificationLogic(IUnitConfig unitConfig, CoreSignals coreSignals)
        {
            UnitConfig = unitConfig;

            coreSignals.RoundBegan.Subscribe(OnRoundBegan);
        }
 private void InjectSignals(CoreSignals coreSignals)
 {
     SignalSubscriptions.Add(coreSignals.TurnBegan.Subscribe(OnTurnBegan));
 }