예제 #1
0
    private void MapBuilding()
    {
        BuildingDef def = building.Def;

        if (def.CheckRequiresPowerInput())
        {
            ports |= Ports.PowerIn;
        }
        if (def.CheckRequiresPowerOutput())
        {
            ports |= Ports.PowerOut;
        }
        if (def.CheckRequiresGasInput())
        {
            ports |= Ports.GasIn;
        }
        if (def.CheckRequiresGasOutput())
        {
            ports |= Ports.GasOut;
        }
        if (def.CheckRequiresLiquidInput())
        {
            ports |= Ports.LiquidIn;
        }
        if (def.CheckRequiresLiquidOutput())
        {
            ports |= Ports.LiquidOut;
        }
        if (def.CheckRequiresSolidInput())
        {
            ports |= Ports.SolidIn;
        }
        if (def.CheckRequiresSolidOutput())
        {
            ports |= Ports.SolidOut;
        }
        DiseaseVisualization.Info info = Assets.instance.DiseaseVisualization.GetInfo(def.DiseaseCellVisName);
        if (info.name != null)
        {
            diseaseSourceSprite = Assets.instance.DiseaseVisualization.overlaySprite;
            diseaseSourceColour = info.overlayColour;
        }
        ISecondaryInput component = def.BuildingComplete.GetComponent <ISecondaryInput>();

        if (component != null)
        {
            switch (component.GetSecondaryConduitType())
            {
            case ConduitType.Gas:
                secondary_ports |= Ports.GasIn;
                break;

            case ConduitType.Liquid:
                secondary_ports |= Ports.LiquidIn;
                break;
            }
        }
        ISecondaryOutput component2 = def.BuildingComplete.GetComponent <ISecondaryOutput>();

        if (component2 != null)
        {
            switch (component2.GetSecondaryConduitType())
            {
            case ConduitType.Gas:
                secondary_ports |= Ports.GasOut;
                break;

            case ConduitType.Liquid:
                secondary_ports |= Ports.LiquidOut;
                break;
            }
        }
    }