Use forward slashes instead of underscored to separate building subtypes

develop
Japa 2017-05-07 19:24:30 +05:30
parent e36e4fa1c1
commit a1f692686a
2 changed files with 9 additions and 13 deletions

@ -54,7 +54,7 @@ DFHack::command_result GetBuildingDefList(DFHack::color_ostream &stream, const D
bld->mutable_building_type()->set_building_type(bt); bld->mutable_building_type()->set_building_type(bt);
bld->mutable_building_type()->set_building_subtype(st); bld->mutable_building_type()->set_building_subtype(st);
bld->mutable_building_type()->set_building_custom(-1); bld->mutable_building_type()->set_building_custom(-1);
bld->set_id(ENUM_KEY_STR(building_type, bt) + "_" + ENUM_KEY_STR(furnace_type, st)); bld->set_id(ENUM_KEY_STR(building_type, bt) + "/" + ENUM_KEY_STR(furnace_type, st));
if (st == furnace_type::Custom) if (st == furnace_type::Custom)
{ {
@ -66,7 +66,7 @@ DFHack::command_result GetBuildingDefList(DFHack::color_ostream &stream, const D
bld->mutable_building_type()->set_building_type(bt); bld->mutable_building_type()->set_building_type(bt);
bld->mutable_building_type()->set_building_subtype(st); bld->mutable_building_type()->set_building_subtype(st);
bld->mutable_building_type()->set_building_custom(cust->id); bld->mutable_building_type()->set_building_custom(cust->id);
bld->set_id(cust->code); bld->set_id(ENUM_KEY_STR(building_type, bt) + "/" + cust->code);
bld->set_name(cust->name); bld->set_name(cust->name);
} }
} }
@ -81,7 +81,7 @@ DFHack::command_result GetBuildingDefList(DFHack::color_ostream &stream, const D
bld->mutable_building_type()->set_building_type(bt); bld->mutable_building_type()->set_building_type(bt);
bld->mutable_building_type()->set_building_subtype(st); bld->mutable_building_type()->set_building_subtype(st);
bld->mutable_building_type()->set_building_custom(-1); bld->mutable_building_type()->set_building_custom(-1);
bld->set_id(ENUM_KEY_STR(building_type, bt) + "_" + ENUM_KEY_STR(shop_type, st)); bld->set_id(ENUM_KEY_STR(building_type, bt) + "/" + ENUM_KEY_STR(shop_type, st));
} }
break; break;
@ -102,7 +102,7 @@ DFHack::command_result GetBuildingDefList(DFHack::color_ostream &stream, const D
bld->mutable_building_type()->set_building_type(bt); bld->mutable_building_type()->set_building_type(bt);
bld->mutable_building_type()->set_building_subtype(st); bld->mutable_building_type()->set_building_subtype(st);
bld->mutable_building_type()->set_building_custom(-1); bld->mutable_building_type()->set_building_custom(-1);
bld->set_id(ENUM_KEY_STR(building_type, bt) + "_" + ENUM_KEY_STR(workshop_type, st)); bld->set_id(ENUM_KEY_STR(building_type, bt) + "/" + ENUM_KEY_STR(workshop_type, st));
if (st == workshop_type::Custom) if (st == workshop_type::Custom)
{ {
@ -114,7 +114,7 @@ DFHack::command_result GetBuildingDefList(DFHack::color_ostream &stream, const D
bld->mutable_building_type()->set_building_type(bt); bld->mutable_building_type()->set_building_type(bt);
bld->mutable_building_type()->set_building_subtype(st); bld->mutable_building_type()->set_building_subtype(st);
bld->mutable_building_type()->set_building_custom(cust->id); bld->mutable_building_type()->set_building_custom(cust->id);
bld->set_id(cust->code); bld->set_id(ENUM_KEY_STR(building_type, bt) + "/" + cust->code);
bld->set_name(cust->name); bld->set_name(cust->name);
} }
} }
@ -143,7 +143,7 @@ DFHack::command_result GetBuildingDefList(DFHack::color_ostream &stream, const D
bld->mutable_building_type()->set_building_type(bt); bld->mutable_building_type()->set_building_type(bt);
bld->mutable_building_type()->set_building_subtype(st); bld->mutable_building_type()->set_building_subtype(st);
bld->mutable_building_type()->set_building_custom(-1); bld->mutable_building_type()->set_building_custom(-1);
bld->set_id(ENUM_KEY_STR(building_type, bt) + "_" + ENUM_KEY_STR(siegeengine_type, st)); bld->set_id(ENUM_KEY_STR(building_type, bt) + "/" + ENUM_KEY_STR(siegeengine_type, st));
} }
break; break;
@ -154,7 +154,7 @@ DFHack::command_result GetBuildingDefList(DFHack::color_ostream &stream, const D
bld->mutable_building_type()->set_building_type(bt); bld->mutable_building_type()->set_building_type(bt);
bld->mutable_building_type()->set_building_subtype(st); bld->mutable_building_type()->set_building_subtype(st);
bld->mutable_building_type()->set_building_custom(-1); bld->mutable_building_type()->set_building_custom(-1);
bld->set_id(ENUM_KEY_STR(building_type, bt) + "_" + ENUM_KEY_STR(trap_type, st)); bld->set_id(ENUM_KEY_STR(building_type, bt) + "/" + ENUM_KEY_STR(trap_type, st));
} }
break; break;
@ -177,7 +177,7 @@ DFHack::command_result GetBuildingDefList(DFHack::color_ostream &stream, const D
bld->mutable_building_type()->set_building_type(bt); bld->mutable_building_type()->set_building_type(bt);
bld->mutable_building_type()->set_building_subtype(st); bld->mutable_building_type()->set_building_subtype(st);
bld->mutable_building_type()->set_building_custom(-1); bld->mutable_building_type()->set_building_custom(-1);
bld->set_id(ENUM_KEY_STR(building_type, bt) + "_" + ENUM_KEY_STR(civzone_type, st)); bld->set_id(ENUM_KEY_STR(building_type, bt) + "/" + ENUM_KEY_STR(civzone_type, st));
} }
break; break;
@ -194,7 +194,7 @@ DFHack::command_result GetBuildingDefList(DFHack::color_ostream &stream, const D
bld->mutable_building_type()->set_building_type(bt); bld->mutable_building_type()->set_building_type(bt);
bld->mutable_building_type()->set_building_subtype(st); bld->mutable_building_type()->set_building_subtype(st);
bld->mutable_building_type()->set_building_custom(-1); bld->mutable_building_type()->set_building_custom(-1);
bld->set_id(ENUM_KEY_STR(building_type, bt) + "_" + ENUM_KEY_STR(construction_type, st)); bld->set_id(ENUM_KEY_STR(building_type, bt) + "/" + ENUM_KEY_STR(construction_type, st));
} }
break; break;

@ -593,7 +593,6 @@ void CopyMat(RemoteFortressReader::MatPair * mat, int type, int index)
map<DFCoord, uint16_t> hashes; map<DFCoord, uint16_t> hashes;
//check if the tiletypes have changed
bool IsTiletypeChanged(DFCoord pos) bool IsTiletypeChanged(DFCoord pos)
{ {
uint16_t hash; uint16_t hash;
@ -612,7 +611,6 @@ bool IsTiletypeChanged(DFCoord pos)
map<DFCoord, uint16_t> waterHashes; map<DFCoord, uint16_t> waterHashes;
//check if the designations have changed
bool IsDesignationChanged(DFCoord pos) bool IsDesignationChanged(DFCoord pos)
{ {
uint16_t hash; uint16_t hash;
@ -631,7 +629,6 @@ bool IsDesignationChanged(DFCoord pos)
map<DFCoord, uint8_t> buildingHashes; map<DFCoord, uint8_t> buildingHashes;
//check if the designations have changed
bool IsBuildingChanged(DFCoord pos) bool IsBuildingChanged(DFCoord pos)
{ {
df::map_block * block = Maps::getBlock(pos); df::map_block * block = Maps::getBlock(pos);
@ -652,7 +649,6 @@ bool IsBuildingChanged(DFCoord pos)
map<DFCoord, uint16_t> spatterHashes; map<DFCoord, uint16_t> spatterHashes;
//check if map spatters have changed
bool IsspatterChanged(DFCoord pos) bool IsspatterChanged(DFCoord pos)
{ {
df::map_block * block = Maps::getBlock(pos); df::map_block * block = Maps::getBlock(pos);