private void GenerateDistrictProxy(int empireIndex, WorldPosition worldPosition, SimulationObject districtProxy) { districtProxy.RemoveAllDescriptors_ModifierForwardType_ChildrenOnly(); if (this.WorldPositionningService != null) { DepartmentOfTheInterior.ApplyDistrictProxyDescriptors(base.Game.Empires[empireIndex], districtProxy, worldPosition, DistrictType.Exploitation, true, false); districtProxy.Refresh(); } }
private void FillWorldPositionEffects(Amplitude.Unity.Game.Empire activeEmpire, WorldPosition worldPosition, bool showTerraformDescriptors = false) { SimulationObject simulationObject = null; if (this.worldPositionningService.IsExploitable(worldPosition, activeEmpire.Bits)) { Region region = this.worldPositionningService.GetRegion(worldPosition); bool flag = region != null && region.BelongToEmpire(activeEmpire as global::Empire) && region.City != null; if (!region.IsOcean && !region.IsWasteland && simulationObject == null) { this.districtProxy.RemoveAllDescriptors_ModifierForwardType_ChildrenOnly(); DepartmentOfTheInterior.ApplyDistrictProxyDescriptors(activeEmpire, this.districtProxy, worldPosition, DistrictType.Exploitation, true, showTerraformDescriptors); if (flag) { if (this.districtProxy.Parent != region.City.SimulationObject) { region.City.SimulationObject.AddChild_ModifierForwardType_ChildrenOnly(this.districtProxy); } region.City.Refresh(true); } else { if (this.districtProxy.Parent != this.cityProxy) { this.cityProxy.AddChild_ModifierForwardType_ChildrenOnly(this.districtProxy); } if (this.cityProxy.Parent != activeEmpire.SimulationObject) { activeEmpire.SimulationObject.AddChild(this.cityProxy); } this.cityProxy.Refresh(); } simulationObject = this.districtProxy; simulationObject.Refresh(); } } if (simulationObject != null) { for (int i = 0; i < this.properties.Count; i++) { this.propertyValues[i] += simulationObject.GetPropertyValue(this.properties[i]); } } }