コード例 #1
0
ファイル: District.cs プロジェクト: LeaderEnemyBoss/ELCP
    public void RefreshTerrainDescriptors()
    {
        if (base.SimulationObject == null)
        {
            return;
        }
        IWorldPositionningService service = ((global::Game)Services.GetService <IGameService>().Game).GetService <IWorldPositionningService>();

        DepartmentOfTheInterior.RemoveAnyTerrainTypeDescriptor(base.SimulationObject);
        DepartmentOfTheInterior.RemoveAnyBiomeTypeDescriptor(base.SimulationObject);
        DepartmentOfTheInterior.RemoveAnyAnomalyDescriptor(base.SimulationObject);
        DepartmentOfTheInterior.RemoveAnyRiverTypeDescriptor(base.SimulationObject);
        byte         terrainType            = service.GetTerrainType(this.WorldPosition);
        StaticString terrainTypeMappingName = service.GetTerrainTypeMappingName(terrainType);

        DepartmentOfTheInterior.ApplyTerrainTypeDescriptor(base.SimulationObject, terrainTypeMappingName);
        byte         biomeType            = service.GetBiomeType(this.WorldPosition);
        StaticString biomeTypeMappingName = service.GetBiomeTypeMappingName(biomeType);

        DepartmentOfTheInterior.ApplyBiomeTypeDescriptor(base.SimulationObject, biomeTypeMappingName);
        byte         anomalyType            = service.GetAnomalyType(this.WorldPosition);
        StaticString anomalyTypeMappingName = service.GetAnomalyTypeMappingName(anomalyType);

        DepartmentOfTheInterior.ApplyAnomalyDescriptor(base.SimulationObject, anomalyTypeMappingName);
        short        riverId = service.GetRiverId(this.WorldPosition);
        StaticString riverTypeMappingName = service.GetRiverTypeMappingName(riverId);

        DepartmentOfTheInterior.ApplyRiverTypeDescriptor(base.SimulationObject, riverTypeMappingName);
        this.Refresh(false);
    }