diff options
| author | Quietust | 2012-02-13 16:56:33 -0600 |
|---|---|---|
| committer | Quietust | 2012-02-13 16:56:33 -0600 |
| commit | d0a8c2edd8922673d72a18bfd2214ce45126507b (patch) | |
| tree | b64220558035888a0cea2f0ee7354f4a20b27ecc /plugins/prospector.cpp | |
| parent | 9f43d61c2c4f1a9ae760158d3e57601e39ff4a24 (diff) | |
| download | dfhack-d0a8c2edd8922673d72a18bfd2214ce45126507b.tar.gz dfhack-d0a8c2edd8922673d72a18bfd2214ce45126507b.tar.bz2 dfhack-d0a8c2edd8922673d72a18bfd2214ce45126507b.tar.xz | |
Move TileTypes to XML, part 1 - a bunch of stuff is now broken
Diffstat (limited to 'plugins/prospector.cpp')
| -rw-r--r-- | plugins/prospector.cpp | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/plugins/prospector.cpp b/plugins/prospector.cpp index b7ade149..ea59a550 100644 --- a/plugins/prospector.cpp +++ b/plugins/prospector.cpp @@ -471,27 +471,21 @@ DFhackCExport command_result prospector (DFHack::Core * c, vector <string> & par liquidWater.add(global_z); } - uint16_t type = b->TileTypeAt(coord); - const DFHack::TileRow *info = DFHack::getTileRow(type); - - if (!info) - { - con << "Bad type: " << type << std::endl; - continue; - } + df::tiletype type = b->TileTypeAt(coord); + df::tiletype_shape tileshape = tileShape(type); + df::tiletype_material tilemat = tileMaterial(type); // We only care about these types - switch (info->shape) + switch (tileshape) { - case DFHack::WALL: - case DFHack::PILLAR: - case DFHack::FORTIFICATION: + case tiletype_shape::WALL: + case tiletype_shape::FORTIFICATION: break; - case DFHack::EMPTY: + case tiletype_shape::EMPTY: /* A heuristic: tubes inside adamantine have EMPTY:AIR tiles which still have feature_local set. Also check the unrevealed status, so as to exclude any holes mined by the player. */ - if (info->material == DFHack::AIR && + if (tilemat == tiletype_material::AIR && des.bits.feature_local && des.bits.hidden && blockFeatureLocal.type == feature_type::deep_special_tube) { @@ -502,19 +496,19 @@ DFhackCExport command_result prospector (DFHack::Core * c, vector <string> & par } // Count the material type - baseMats[info->material].add(global_z); + baseMats[tilemat].add(global_z); // Find the type of the tile - switch (info->material) + switch (tilemat) { - case DFHack::SOIL: - case DFHack::STONE: + case tiletype_material::SOIL: + case tiletype_material::STONE: layerMats[b->baseMaterialAt(coord)].add(global_z); break; - case DFHack::VEIN: + case tiletype_material::MINERAL: veinMats[b->veinMaterialAt(coord)].add(global_z); break; - case DFHack::FEATSTONE: + case tiletype_material::FEATURE: if (blockFeatureLocal.type != -1 && des.bits.feature_local) { if (blockFeatureLocal.type == feature_type::deep_special_tube @@ -536,7 +530,7 @@ DFhackCExport command_result prospector (DFHack::Core * c, vector <string> & par layerMats[blockFeatureGlobal.sub_material].add(global_z); } break; - case DFHack::OBSIDIAN: + case tiletype_material::LAVA_STONE: // TODO ? break; } @@ -578,7 +572,7 @@ DFhackCExport command_result prospector (DFHack::Core * c, vector <string> & par con << "Base materials:" << std::endl; for (it = baseMats.begin(); it != baseMats.end(); ++it) { - con << std::setw(25) << DFHack::TileMaterialString[it->first] << " : " << it->second.count << std::endl; + con << std::setw(25) << tiletype_material::get_key((df::tiletype_material)it->first) << " : " << it->second.count << std::endl; } if (liquidWater.count || liquidMagma.count) |
