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());
        }
Пример #2
0
        public ExplorationCanon(
            IGameCore gameCore, VisibilitySignals visibilitySignals, HexCellSignals cellSignals
            )
        {
            GameCore          = gameCore;
            VisibilitySignals = visibilitySignals;
            CellSignals       = cellSignals;

            CellSignals.MapBeingClearedSignal.Subscribe(unit => Clear());
        }
        public VisibilityCanon(
            IGameCore gameCore, ITechCanon techCanon, VisibilitySignals visibilitySignals,
            HexCellSignals cellSignals
            )
        {
            GameCore          = gameCore;
            TechCanon         = techCanon;
            VisibilitySignals = visibilitySignals;

            cellSignals.MapBeingClearedSignal.Subscribe(unit => ClearCellVisibility());
        }