예제 #1
0
 public void InitOrModifyTile(DFCoord coord,
                        int? tileType = null,
                        MatPairStruct? material = null,
                        MatPairStruct? base_material = null,
                        MatPairStruct? layer_material = null,
                        MatPairStruct? vein_material = null,
                        int? waterLevel = null,
                        int? magmaLevel = null,
                        MatPairStruct? construction_item = null,
                        int? rampType = null,
                        BuildingStruct? buildingType = null,
                        MatPairStruct? buildingMaterial = null,
                        DFCoord2d? buildingLocalPos = null,
                        BuildingDirection? buildingDirection = null,
                        bool? hidden = null,
                        byte? trunkPercent = null,
                        DFCoord? positionOnTree = null,
                        TileDigDesignation? digDesignation = null,
                        List<Spatter> spatters = null)
 {
     if (!InSliceBounds(coord)) {
         throw new UnityException("Can't modify tile outside of slice");
     }
     if (this[coord] == null)
         this[coord] = new Tile(this, coord);
     this[coord].Modify(
         tileType,
         material,
         base_material,
         layer_material,
         vein_material,
         waterLevel,
         magmaLevel,
         construction_item,
         rampType,
         buildingType,
         buildingMaterial,
         buildingLocalPos,
         buildingDirection,
         hidden,
         trunkPercent,
         positionOnTree,
         digDesignation,
         spatters
         );
 }
예제 #2
0
 public Tile(MapDataStore container, DFCoord position)
 {
     this.container = container;
     this.position = position;
     tileType = default(int);
     material = default(MatPairStruct);
     base_material = default(MatPairStruct);
     layer_material = default(MatPairStruct);
     vein_material = default(MatPairStruct);
     construction_item = default(MatPairStruct);
     waterLevel = default(int);
     magmaLevel = default(int);
     rampType = 0;
     buildingMaterial = default(MatPairStruct);
     buildingType = default(BuildingStruct);
     buildingLocalPos = default(DFCoord2d);
     buildingDirection = 0;
     Hidden = false;
     trunkPercent = 0;
     positionOnTree = default(DFCoord);
     digDesignation = TileDigDesignation.NO_DIG;
     spatters = null;
 }
예제 #3
0
 public void Modify(int? tileType = null,
                    MatPairStruct? material = null,
                    MatPairStruct? base_material = null,
                    MatPairStruct? layer_material = null,
                    MatPairStruct? vein_material = null,
                    int? waterLevel = null,
                    int? magmaLevel = null,
                    MatPairStruct? construction_item = null,
                    int? rampType = null,
                    BuildingStruct? buildingType = null,
                    MatPairStruct? buildingMaterial = null,
                    DFCoord2d? buildingLocalPos = null,
                    BuildingDirection? buildingDirection = null,
                    bool? hidden = null,
                    byte? trunkPercent = null,
                    DFCoord? positionOnTree = null,
                    TileDigDesignation? digDesignation = null,
                    List<Spatter> spatters = null)
 {
     if (tileType != null) {
         this.tileType = tileType.Value;
     }
     if (material != null) {
         this.material = material.Value;
     }
     if (base_material != null) {
         this.base_material = base_material.Value;
     }
     if (layer_material != null) {
         this.layer_material = layer_material.Value;
     }
     if (vein_material != null) {
         this.vein_material = vein_material.Value;
     }
     if (waterLevel != null) {
         this.waterLevel = waterLevel.Value;
     }
     if (magmaLevel != null) {
         this.magmaLevel = magmaLevel.Value;
     }
     if (construction_item != null)
     {
         this.construction_item = construction_item.Value;
     }
     if(rampType != null)
     {
         this.rampType = rampType.Value;
     }
     if(buildingType != null)
     {
         this.buildingType = buildingType.Value;
     }
     if(buildingMaterial != null)
     {
         this.buildingMaterial = buildingMaterial.Value;
     }
     if (buildingLocalPos != null)
         this.buildingLocalPos = buildingLocalPos.Value;
     if (buildingDirection != null)
         this.buildingDirection = buildingDirection.Value;
     if (hidden != null)
         Hidden = hidden.Value;
     if (trunkPercent != null)
         this.trunkPercent = trunkPercent.Value;
     if (positionOnTree != null)
         this.positionOnTree = positionOnTree.Value;
     if (digDesignation != null)
         this.digDesignation = digDesignation.Value;
     if (spatters != null)
         this.spatters = spatters;
 }
예제 #4
0
 public void CopyFrom(Tile orig)
 {
     container = orig.container;
     position = orig.position;
     tileType = orig.tileType;
     material = orig.material;
     base_material = orig.base_material;
     layer_material = orig.layer_material;
     vein_material = orig.vein_material;
     construction_item = orig.construction_item;
     waterLevel = orig.waterLevel;
     magmaLevel = orig.magmaLevel;
     RampType = orig.RampType;
     buildingType = orig.buildingType;
     buildingMaterial = orig.buildingMaterial;
     buildingLocalPos = orig.buildingLocalPos;
     buildingDirection = orig.buildingDirection;
     Hidden = orig.Hidden;
     trunkPercent = orig.trunkPercent;
     positionOnTree = orig.positionOnTree;
     digDesignation = orig.digDesignation;
     spatters = orig.spatters;
 }
예제 #5
0
 bool GetDesignation(out TileDigDesignation designation)
 {
     switch (digMode)
     {
         case DigMode.Dig:
             designation = TileDigDesignation.DEFAULT_DIG;
             break;
         case DigMode.Channel:
             designation = TileDigDesignation.CHANNEL_DIG;
             break;
         case DigMode.UpStair:
             designation = TileDigDesignation.UP_STAIR_DIG;
             break;
         case DigMode.DownStair:
             designation = TileDigDesignation.DOWN_STAIR_DIG;
             break;
         case DigMode.UpDownStair:
             designation = TileDigDesignation.UP_DOWN_STAIR_DIG;
             break;
         case DigMode.UpRamp:
             designation = TileDigDesignation.RAMP_DIG;
             break;
         case DigMode.RemoveUpStairRamp:
             designation = TileDigDesignation.DEFAULT_DIG;
             break;
         case DigMode.ChopTrees:
             designation = TileDigDesignation.DEFAULT_DIG;
             break;
         case DigMode.GatherPlants:
             designation = TileDigDesignation.DEFAULT_DIG;
             break;
         //case DigMode.SmoothStone:
         //    command.designation = TileDigDesignation.DEFAULT_DIG;
         //    break;
         //case DigMode.EngraveStone:
         //    command.designation = TileDigDesignation.DEFAULT_DIG;
         //    break;
         //case DigMode.CarveFortifications:
         //    command.designation = TileDigDesignation.DEFAULT_DIG;
         //    break;
         //case DigMode.RemoveConstruction:
         //    command.designation = TileDigDesignation.DEFAULT_DIG;
         //    break;
         case DigMode.RemoveDesignation:
             designation = TileDigDesignation.NO_DIG;
             break;
         default:
             designation = TileDigDesignation.NO_DIG;
             return false;
     }
     return true;
 }
예제 #6
0
 public void Modify(int?tileType                        = null,
                    MatPairStruct?material              = null,
                    MatPairStruct?base_material         = null,
                    MatPairStruct?layer_material        = null,
                    MatPairStruct?vein_material         = null,
                    int?waterLevel                      = null,
                    int?magmaLevel                      = null,
                    MatPairStruct?construction_item     = null,
                    int?rampType                        = null,
                    BuildingStruct?buildingType         = null,
                    MatPairStruct?buildingMaterial      = null,
                    DFCoord2d?buildingLocalPos          = null,
                    BuildingDirection?buildingDirection = null,
                    bool?hidden                       = null,
                    byte?trunkPercent                 = null,
                    DFCoord?positionOnTree            = null,
                    TileDigDesignation?digDesignation = null,
                    List <Spatter> spatters           = null)
 {
     if (tileType != null)
     {
         this.tileType = tileType.Value;
     }
     if (material != null)
     {
         this.material = material.Value;
     }
     if (base_material != null)
     {
         this.base_material = base_material.Value;
     }
     if (layer_material != null)
     {
         this.layer_material = layer_material.Value;
     }
     if (vein_material != null)
     {
         this.vein_material = vein_material.Value;
     }
     if (waterLevel != null)
     {
         this.waterLevel = waterLevel.Value;
     }
     if (magmaLevel != null)
     {
         this.magmaLevel = magmaLevel.Value;
     }
     if (construction_item != null)
     {
         this.construction_item = construction_item.Value;
     }
     if (rampType != null)
     {
         this.rampType = rampType.Value;
     }
     if (buildingType != null)
     {
         this.buildingType = buildingType.Value;
     }
     if (buildingMaterial != null)
     {
         this.buildingMaterial = buildingMaterial.Value;
     }
     if (buildingLocalPos != null)
     {
         this.buildingLocalPos = buildingLocalPos.Value;
     }
     if (buildingDirection != null)
     {
         this.buildingDirection = buildingDirection.Value;
     }
     if (hidden != null)
     {
         Hidden = hidden.Value;
     }
     if (trunkPercent != null)
     {
         this.trunkPercent = trunkPercent.Value;
     }
     if (positionOnTree != null)
     {
         this.positionOnTree = positionOnTree.Value;
     }
     if (digDesignation != null)
     {
         this.digDesignation = digDesignation.Value;
     }
     if (spatters != null)
     {
         this.spatters = spatters;
     }
 }
예제 #7
0
    bool GetDesignation(out TileDigDesignation designation)
    {
        switch (digMode)
        {
        case DigMode.Dig:
            designation = TileDigDesignation.DEFAULT_DIG;
            break;

        case DigMode.Channel:
            designation = TileDigDesignation.CHANNEL_DIG;
            break;

        case DigMode.UpStair:
            designation = TileDigDesignation.UP_STAIR_DIG;
            break;

        case DigMode.DownStair:
            designation = TileDigDesignation.DOWN_STAIR_DIG;
            break;

        case DigMode.UpDownStair:
            designation = TileDigDesignation.UP_DOWN_STAIR_DIG;
            break;

        case DigMode.UpRamp:
            designation = TileDigDesignation.RAMP_DIG;
            break;

        case DigMode.RemoveUpStairRamp:
            designation = TileDigDesignation.DEFAULT_DIG;
            break;

        case DigMode.ChopTrees:
            designation = TileDigDesignation.DEFAULT_DIG;
            break;

        case DigMode.GatherPlants:
            designation = TileDigDesignation.DEFAULT_DIG;
            break;

        //case DigMode.SmoothStone:
        //    command.designation = TileDigDesignation.DEFAULT_DIG;
        //    break;
        //case DigMode.EngraveStone:
        //    command.designation = TileDigDesignation.DEFAULT_DIG;
        //    break;
        //case DigMode.CarveFortifications:
        //    command.designation = TileDigDesignation.DEFAULT_DIG;
        //    break;
        //case DigMode.RemoveConstruction:
        //    command.designation = TileDigDesignation.DEFAULT_DIG;
        //    break;
        case DigMode.RemoveDesignation:
            designation = TileDigDesignation.NO_DIG;
            break;

        default:
            designation = TileDigDesignation.NO_DIG;
            return(false);
        }
        return(true);
    }