Example #1
0
    public virtual void ConfirmModifications()
    {
        _placementManager.PlaceStructuresOnTheMap(_structuresToBeModified.Values);
        Type structureType = _structureData.GetType();

        foreach (var keyValuePair in _structuresToBeModified)
        {
            _grid.PlaceStructureOnTheGrid(keyValuePair.Value, keyValuePair.Key, GameObject.Instantiate(_structureData));
            StructureEconomyManager.CheckStructureTypeForCreationPreparation(structureType, keyValuePair.Key, _grid);
        }
        ResetHelpersData();
    }
Example #2
0
    public virtual void ConfirmModifications()
    {
        placementManager.PlaceStructuresOnTheMap(structuresToBeModified.Values);
        Type structureType = structureData.GetType();

        foreach (var keyValuePair in structuresToBeModified)
        {
            grid.PlaceStructureOnTheGrid(keyValuePair.Value, keyValuePair.Key, GameObject.Instantiate(structureData));
            StructureEconomyManager.CreateStructureLogic(structureType, keyValuePair.Key, grid);
        }
        ResetHelpersData();
    }
Example #3
0
 private void CheckStructureToDisplayMaterialBuildTimeText(StructureBaseSO structure)
 {
     if (structure.GetType() == typeof(ManufacturerBaseSO))
     {
         SetText(materialBuildTimeText, ((ManufacturerBaseSO)structure).GetMaterialBuildTimer() + "'s");
     }
     else
     {
         HideElement(materialBuildTimeText.gameObject);
     }
 }
Example #4
0
    private void UpdateStructureInfoPanel(StructureBaseSO data)
    {
        Type dataType = data.GetType();

        if (dataType == typeof(SingleFacilitySO))
        {
            this.gameManager.uiController.DisplayFacilitStructureInfo((SingleFacilitySO)data);
        }
        else if (dataType == typeof(ZoneStructureSO))
        {
            this.gameManager.uiController.DisplayZoneStructureInfo((ZoneStructureSO)data);
        }
        else
        {
            this.gameManager.uiController.DisplayBasicStructureInfo(data);
        }
    }
Example #5
0
    private void UpdateStructureInfoPanel(StructureBaseSO structureData)
    {
        Type structureDataType = structureData.GetType();

        if (structureDataType == typeof(SingleFacilitySO))
        {
            this._gameManager.uIController.DisplayFacilityStructureInfo((SingleFacilitySO)structureData);
        }
        else if (structureDataType == typeof(ZoneStructureSO))
        {
            this._gameManager.uIController.DisplayZoneStructureInfo((ZoneStructureSO)structureData);
        }
        else if (structureDataType == typeof(ManufacturerBaseSO))
        {
            this._gameManager.uIController.DisplayManufactureStructureInfo((ManufacturerBaseSO)structureData);
        }
        else
        {
            this._gameManager.uIController.DisplayBasicStructureInfo(structureData);
        }
    }
 private void PrepareStructureForUpgrade(StructureBaseSO structureData)
 {
     if (structureData != null)
     {
         Type dataType = structureData.GetType();
         if (dataType == typeof(ZoneStructureSO) && ((ZoneStructureSO)structureData).zoneType == ZoneType.Residential)
         {
             var zoneStructure = (ZoneStructureSO)structureData;
             structureData = zoneStructure;
             _resourceManager.SetUpgradedPopulationAmount(zoneStructure.GetResidentsAmount(), zoneStructure.SetUpgradedResidentsAmount());
         }
         if (dataType == typeof(SingleFacilitySO))
         {
             ((SingleFacilitySO)structureData).SetUpgradedMaxCustomers();
         }
         else
         {
             structureData.GetUpgradedIncome();
         }
         structureData.IncreaseUpgradeLevel();
     }
 }