Skip to content

Commit

Permalink
Use forward slashes instead of underscored to separate building subtypes
Browse files Browse the repository at this point in the history
  • Loading branch information
RosaryMala committed May 7, 2017
1 parent e36e4fa commit a1f6926
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
18 changes: 9 additions & 9 deletions plugins/remotefortressreader/building_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_subtype(st);
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)
{
Expand All @@ -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_subtype(st);
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);
}
}
Expand All @@ -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_subtype(st);
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;
Expand All @@ -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_subtype(st);
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)
{
Expand All @@ -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_subtype(st);
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);
}
}
Expand Down Expand Up @@ -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_subtype(st);
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;
Expand All @@ -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_subtype(st);
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;
Expand All @@ -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_subtype(st);
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;
Expand All @@ -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_subtype(st);
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;
Expand Down
4 changes: 0 additions & 4 deletions plugins/remotefortressreader/remotefortressreader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,6 @@ void CopyMat(RemoteFortressReader::MatPair * mat, int type, int index)

map<DFCoord, uint16_t> hashes;

//check if the tiletypes have changed
bool IsTiletypeChanged(DFCoord pos)
{
uint16_t hash;
Expand All @@ -612,7 +611,6 @@ bool IsTiletypeChanged(DFCoord pos)

map<DFCoord, uint16_t> waterHashes;

//check if the designations have changed
bool IsDesignationChanged(DFCoord pos)
{
uint16_t hash;
Expand All @@ -631,7 +629,6 @@ bool IsDesignationChanged(DFCoord pos)

map<DFCoord, uint8_t> buildingHashes;

//check if the designations have changed
bool IsBuildingChanged(DFCoord pos)
{
df::map_block * block = Maps::getBlock(pos);
Expand All @@ -652,7 +649,6 @@ bool IsBuildingChanged(DFCoord pos)

map<DFCoord, uint16_t> spatterHashes;

//check if map spatters have changed
bool IsspatterChanged(DFCoord pos)
{
df::map_block * block = Maps::getBlock(pos);
Expand Down

0 comments on commit a1f6926

Please sign in to comment.