2017-03-25 10:53:40 -06:00
|
|
|
#include "building_reader.h"
|
|
|
|
#include "DataDefs.h"
|
|
|
|
|
2017-05-25 04:08:31 -06:00
|
|
|
//building types
|
|
|
|
#include "df/building_actual.h"
|
|
|
|
#include "df/building_chairst.h"
|
|
|
|
#include "df/building_bedst.h"
|
|
|
|
#include "df/building_tablest.h"
|
|
|
|
#include "df/building_coffinst.h"
|
|
|
|
#include "df/building_farmplotst.h"
|
|
|
|
#include "df/building_furnacest.h"
|
|
|
|
#include "df/building_tradedepotst.h"
|
|
|
|
#include "df/building_shopst.h"
|
2017-05-22 10:33:12 -06:00
|
|
|
#include "df/building_doorst.h"
|
|
|
|
#include "df/building_floodgatest.h"
|
2017-05-25 04:08:31 -06:00
|
|
|
#include "df/building_boxst.h"
|
|
|
|
#include "df/building_weaponrackst.h"
|
|
|
|
#include "df/building_armorstandst.h"
|
|
|
|
#include "df/building_workshopst.h"
|
|
|
|
#include "df/building_cabinetst.h"
|
|
|
|
#include "df/building_statuest.h"
|
|
|
|
#include "df/building_window_glassst.h"
|
|
|
|
#include "df/building_window_gemst.h"
|
|
|
|
#include "df/building_wellst.h"
|
|
|
|
#include "df/building_bridgest.h"
|
|
|
|
#include "df/building_road_dirtst.h"
|
|
|
|
#include "df/building_road_pavedst.h"
|
2017-03-25 10:53:40 -06:00
|
|
|
#include "df/building_siegeenginest.h"
|
2017-05-25 04:08:31 -06:00
|
|
|
#include "df/building_trapst.h"
|
|
|
|
#include "df/building_animaltrapst.h"
|
|
|
|
#include "df/building_supportst.h"
|
|
|
|
#include "df/building_archerytargetst.h"
|
|
|
|
#include "df/building_chainst.h"
|
|
|
|
#include "df/building_cagest.h"
|
|
|
|
#include "df/building_stockpilest.h"
|
|
|
|
#include "df/building_civzonest.h"
|
|
|
|
#include "df/building_weaponst.h"
|
|
|
|
#include "df/building_wagonst.h"
|
|
|
|
#include "df/building_screw_pumpst.h"
|
|
|
|
#include "df/building_constructionst.h"
|
|
|
|
#include "df/building_hatchst.h"
|
|
|
|
#include "df/building_grate_wallst.h"
|
|
|
|
#include "df/building_grate_floorst.h"
|
|
|
|
#include "df/building_bars_verticalst.h"
|
|
|
|
#include "df/building_bars_floorst.h"
|
|
|
|
#include "df/building_gear_assemblyst.h"
|
|
|
|
#include "df/building_axle_horizontalst.h"
|
|
|
|
#include "df/building_axle_verticalst.h"
|
2017-03-25 10:53:40 -06:00
|
|
|
#include "df/building_water_wheelst.h"
|
|
|
|
#include "df/building_windmillst.h"
|
2017-05-25 04:08:31 -06:00
|
|
|
#include "df/building_traction_benchst.h"
|
|
|
|
#include "df/building_slabst.h"
|
|
|
|
#include "df/building_nestst.h"
|
|
|
|
#include "df/building_nest_boxst.h"
|
|
|
|
#include "df/building_hivest.h"
|
|
|
|
#include "df/building_rollersst.h"
|
|
|
|
|
|
|
|
#include "df/building_def_furnacest.h"
|
|
|
|
#include "df/building_def_workshopst.h"
|
2017-03-25 10:53:40 -06:00
|
|
|
#include "df/world.h"
|
2017-05-22 10:33:12 -06:00
|
|
|
#include "df/machine.h"
|
2017-03-25 10:53:40 -06:00
|
|
|
|
|
|
|
|
|
|
|
#include "modules/Buildings.h"
|
|
|
|
|
|
|
|
|
|
|
|
using namespace DFHack;
|
|
|
|
using namespace df::enums;
|
|
|
|
using namespace RemoteFortressReader;
|
|
|
|
using namespace std;
|
|
|
|
|
2017-03-29 08:52:09 -06:00
|
|
|
DFHack::command_result GetBuildingDefList(DFHack::color_ostream &stream, const DFHack::EmptyMessage *in, RemoteFortressReader::BuildingList *out)
|
2017-03-25 10:53:40 -06:00
|
|
|
{
|
|
|
|
FOR_ENUM_ITEMS(building_type, bt)
|
|
|
|
{
|
|
|
|
BuildingDefinition * bld = out->add_building_list();
|
|
|
|
bld->mutable_building_type()->set_building_type(bt);
|
|
|
|
bld->mutable_building_type()->set_building_subtype(-1);
|
|
|
|
bld->mutable_building_type()->set_building_custom(-1);
|
|
|
|
bld->set_id(ENUM_KEY_STR(building_type, bt));
|
|
|
|
|
|
|
|
switch (bt)
|
|
|
|
{
|
|
|
|
case df::enums::building_type::NONE:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::Chair:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::Bed:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::Table:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::Coffin:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::FarmPlot:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::Furnace:
|
|
|
|
FOR_ENUM_ITEMS(furnace_type, st)
|
|
|
|
{
|
|
|
|
bld = out->add_building_list();
|
|
|
|
bld->mutable_building_type()->set_building_type(bt);
|
|
|
|
bld->mutable_building_type()->set_building_subtype(st);
|
|
|
|
bld->mutable_building_type()->set_building_custom(-1);
|
2017-05-07 07:54:30 -06:00
|
|
|
bld->set_id(ENUM_KEY_STR(building_type, bt) + "/" + ENUM_KEY_STR(furnace_type, st));
|
2017-03-25 10:53:40 -06:00
|
|
|
|
|
|
|
if (st == furnace_type::Custom)
|
|
|
|
{
|
2018-04-06 13:17:34 -06:00
|
|
|
for (size_t i = 0; i < df::global::world->raws.buildings.furnaces.size(); i++)
|
2017-03-25 10:53:40 -06:00
|
|
|
{
|
|
|
|
auto cust = df::global::world->raws.buildings.furnaces[i];
|
|
|
|
|
|
|
|
bld = out->add_building_list();
|
|
|
|
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);
|
2017-05-07 07:54:30 -06:00
|
|
|
bld->set_id(ENUM_KEY_STR(building_type, bt) + "/" + cust->code);
|
2017-03-25 10:53:40 -06:00
|
|
|
bld->set_name(cust->name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::TradeDepot:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::Shop:
|
|
|
|
FOR_ENUM_ITEMS(shop_type, st)
|
|
|
|
{
|
|
|
|
bld = out->add_building_list();
|
|
|
|
bld->mutable_building_type()->set_building_type(bt);
|
|
|
|
bld->mutable_building_type()->set_building_subtype(st);
|
|
|
|
bld->mutable_building_type()->set_building_custom(-1);
|
2017-05-07 07:54:30 -06:00
|
|
|
bld->set_id(ENUM_KEY_STR(building_type, bt) + "/" + ENUM_KEY_STR(shop_type, st));
|
2017-03-25 10:53:40 -06:00
|
|
|
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::Door:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::Floodgate:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::Box:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::Weaponrack:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::Armorstand:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::Workshop:
|
|
|
|
FOR_ENUM_ITEMS(workshop_type, st)
|
|
|
|
{
|
|
|
|
bld = out->add_building_list();
|
|
|
|
bld->mutable_building_type()->set_building_type(bt);
|
|
|
|
bld->mutable_building_type()->set_building_subtype(st);
|
|
|
|
bld->mutable_building_type()->set_building_custom(-1);
|
2017-05-07 07:54:30 -06:00
|
|
|
bld->set_id(ENUM_KEY_STR(building_type, bt) + "/" + ENUM_KEY_STR(workshop_type, st));
|
2017-03-25 10:53:40 -06:00
|
|
|
|
|
|
|
if (st == workshop_type::Custom)
|
|
|
|
{
|
2018-04-06 13:17:34 -06:00
|
|
|
for (size_t i = 0; i < df::global::world->raws.buildings.workshops.size(); i++)
|
2017-03-25 10:53:40 -06:00
|
|
|
{
|
|
|
|
auto cust = df::global::world->raws.buildings.workshops[i];
|
|
|
|
|
|
|
|
bld = out->add_building_list();
|
|
|
|
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);
|
2017-05-07 07:54:30 -06:00
|
|
|
bld->set_id(ENUM_KEY_STR(building_type, bt) + "/" + cust->code);
|
2017-03-25 10:53:40 -06:00
|
|
|
bld->set_name(cust->name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::Cabinet:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::Statue:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::WindowGlass:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::WindowGem:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::Well:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::Bridge:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::RoadDirt:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::RoadPaved:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::SiegeEngine:
|
|
|
|
FOR_ENUM_ITEMS(siegeengine_type, st)
|
|
|
|
{
|
|
|
|
bld = out->add_building_list();
|
|
|
|
bld->mutable_building_type()->set_building_type(bt);
|
|
|
|
bld->mutable_building_type()->set_building_subtype(st);
|
|
|
|
bld->mutable_building_type()->set_building_custom(-1);
|
2017-05-07 07:54:30 -06:00
|
|
|
bld->set_id(ENUM_KEY_STR(building_type, bt) + "/" + ENUM_KEY_STR(siegeengine_type, st));
|
2017-03-25 10:53:40 -06:00
|
|
|
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::Trap:
|
|
|
|
FOR_ENUM_ITEMS(trap_type, st)
|
|
|
|
{
|
|
|
|
bld = out->add_building_list();
|
|
|
|
bld->mutable_building_type()->set_building_type(bt);
|
|
|
|
bld->mutable_building_type()->set_building_subtype(st);
|
|
|
|
bld->mutable_building_type()->set_building_custom(-1);
|
2017-05-07 07:54:30 -06:00
|
|
|
bld->set_id(ENUM_KEY_STR(building_type, bt) + "/" + ENUM_KEY_STR(trap_type, st));
|
2017-03-25 10:53:40 -06:00
|
|
|
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::AnimalTrap:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::Support:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::ArcheryTarget:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::Chain:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::Cage:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::Stockpile:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::Civzone:
|
|
|
|
FOR_ENUM_ITEMS(civzone_type, st)
|
|
|
|
{
|
|
|
|
bld = out->add_building_list();
|
|
|
|
bld->mutable_building_type()->set_building_type(bt);
|
|
|
|
bld->mutable_building_type()->set_building_subtype(st);
|
|
|
|
bld->mutable_building_type()->set_building_custom(-1);
|
2017-05-07 07:54:30 -06:00
|
|
|
bld->set_id(ENUM_KEY_STR(building_type, bt) + "/" + ENUM_KEY_STR(civzone_type, st));
|
2017-03-25 10:53:40 -06:00
|
|
|
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::Weapon:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::Wagon:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::ScrewPump:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::Construction:
|
|
|
|
FOR_ENUM_ITEMS(construction_type, st)
|
|
|
|
{
|
|
|
|
bld = out->add_building_list();
|
|
|
|
bld->mutable_building_type()->set_building_type(bt);
|
|
|
|
bld->mutable_building_type()->set_building_subtype(st);
|
|
|
|
bld->mutable_building_type()->set_building_custom(-1);
|
2017-05-07 07:54:30 -06:00
|
|
|
bld->set_id(ENUM_KEY_STR(building_type, bt) + "/" + ENUM_KEY_STR(construction_type, st));
|
2017-03-25 10:53:40 -06:00
|
|
|
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::Hatch:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::GrateWall:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::GrateFloor:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::BarsVertical:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::BarsFloor:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::GearAssembly:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::AxleHorizontal:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::AxleVertical:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::WaterWheel:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::Windmill:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::TractionBench:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::Slab:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::Nest:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::NestBox:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::Hive:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::Rollers:
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return CR_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CopyBuilding(int buildingIndex, RemoteFortressReader::BuildingInstance * remote_build)
|
|
|
|
{
|
|
|
|
df::building * local_build = df::global::world->buildings.all[buildingIndex];
|
2017-07-17 03:59:23 -06:00
|
|
|
remote_build->set_index(local_build->id);
|
2017-03-25 10:53:40 -06:00
|
|
|
int minZ = local_build->z;
|
|
|
|
if (local_build->getType() == df::enums::building_type::Well)
|
|
|
|
{
|
|
|
|
df::building_wellst * well_building = virtual_cast<df::building_wellst>(local_build);
|
|
|
|
if (well_building)
|
|
|
|
minZ = well_building->bucket_z;
|
|
|
|
}
|
|
|
|
remote_build->set_pos_x_min(local_build->x1);
|
|
|
|
remote_build->set_pos_y_min(local_build->y1);
|
|
|
|
remote_build->set_pos_z_min(minZ);
|
|
|
|
|
|
|
|
remote_build->set_pos_x_max(local_build->x2);
|
|
|
|
remote_build->set_pos_y_max(local_build->y2);
|
|
|
|
remote_build->set_pos_z_max(local_build->z);
|
|
|
|
|
|
|
|
auto buildingType = remote_build->mutable_building_type();
|
|
|
|
auto type = local_build->getType();
|
|
|
|
buildingType->set_building_type(type);
|
|
|
|
buildingType->set_building_subtype(local_build->getSubtype());
|
|
|
|
buildingType->set_building_custom(local_build->getCustomType());
|
|
|
|
|
|
|
|
auto material = remote_build->mutable_material();
|
|
|
|
material->set_mat_type(local_build->mat_type);
|
|
|
|
material->set_mat_index(local_build->mat_index);
|
|
|
|
|
|
|
|
remote_build->set_building_flags(local_build->flags.whole);
|
|
|
|
remote_build->set_is_room(local_build->is_room);
|
2017-06-22 12:27:04 -06:00
|
|
|
if (local_build->room.width > 0 && local_build->room.height > 0 && local_build->room.extents != nullptr)
|
2017-03-25 10:53:40 -06:00
|
|
|
{
|
|
|
|
auto room = remote_build->mutable_room();
|
|
|
|
room->set_pos_x(local_build->room.x);
|
|
|
|
room->set_pos_y(local_build->room.y);
|
|
|
|
room->set_width(local_build->room.width);
|
|
|
|
room->set_height(local_build->room.height);
|
|
|
|
for (int i = 0; i < (local_build->room.width * local_build->room.height); i++)
|
|
|
|
{
|
|
|
|
room->add_extents(local_build->room.extents[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-05-25 04:08:31 -06:00
|
|
|
//Add building-specific info
|
2017-03-25 10:53:40 -06:00
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case df::enums::building_type::NONE:
|
2017-05-25 04:08:31 -06:00
|
|
|
{
|
|
|
|
auto actual = virtual_cast<df::building_actual>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
break;
|
2017-05-25 04:08:31 -06:00
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
case df::enums::building_type::Chair:
|
2017-05-25 04:08:31 -06:00
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_chairst>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
break;
|
2017-05-25 04:08:31 -06:00
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
case df::enums::building_type::Bed:
|
2017-05-25 04:08:31 -06:00
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_bedst>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
break;
|
2017-05-25 04:08:31 -06:00
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
case df::enums::building_type::Table:
|
2017-05-25 04:08:31 -06:00
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_tablest>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
break;
|
2017-05-25 04:08:31 -06:00
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
case df::enums::building_type::Coffin:
|
2017-05-25 04:08:31 -06:00
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_coffinst>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
break;
|
2017-05-25 04:08:31 -06:00
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
case df::enums::building_type::FarmPlot:
|
2017-05-25 04:08:31 -06:00
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_farmplotst>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
break;
|
2017-05-25 04:08:31 -06:00
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
case df::enums::building_type::Furnace:
|
2017-05-25 04:08:31 -06:00
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_furnacest>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
break;
|
2017-05-25 04:08:31 -06:00
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
case df::enums::building_type::TradeDepot:
|
2017-05-25 04:08:31 -06:00
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_tradedepotst>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
break;
|
2017-05-25 04:08:31 -06:00
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
case df::enums::building_type::Shop:
|
2017-05-25 04:08:31 -06:00
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_shopst>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
break;
|
2017-05-25 04:08:31 -06:00
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
case df::enums::building_type::Door:
|
2017-05-22 10:33:12 -06:00
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_doorst>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
if (actual->door_flags.bits.closed)
|
|
|
|
remote_build->set_active(1);
|
|
|
|
else
|
|
|
|
remote_build->set_active(0);
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
break;
|
2017-05-22 10:33:12 -06:00
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
case df::enums::building_type::Floodgate:
|
2017-05-22 10:33:12 -06:00
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_floodgatest>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
if (actual->gate_flags.bits.closed)
|
|
|
|
remote_build->set_active(1);
|
|
|
|
else
|
|
|
|
remote_build->set_active(0);
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
break;
|
2017-05-22 10:33:12 -06:00
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
case df::enums::building_type::Box:
|
2017-05-25 04:08:31 -06:00
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_boxst>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
break;
|
2017-05-25 04:08:31 -06:00
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
case df::enums::building_type::Weaponrack:
|
2017-05-25 04:08:31 -06:00
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_weaponrackst>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
break;
|
2017-05-25 04:08:31 -06:00
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
case df::enums::building_type::Armorstand:
|
2017-05-25 04:08:31 -06:00
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_armorstandst>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
break;
|
2017-05-25 04:08:31 -06:00
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
case df::enums::building_type::Workshop:
|
2017-05-22 10:33:12 -06:00
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_workshopst>(local_build);
|
|
|
|
if (actual && actual->machine.machine_id >= 0)
|
|
|
|
{
|
|
|
|
auto mach = df::machine::find(actual->machine.machine_id);
|
|
|
|
remote_build->set_active(mach->flags.bits.active);
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
break;
|
2017-05-22 10:33:12 -06:00
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
case df::enums::building_type::Cabinet:
|
2017-05-25 04:08:31 -06:00
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_cabinetst>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
break;
|
2017-05-25 04:08:31 -06:00
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
case df::enums::building_type::Statue:
|
2017-05-25 04:08:31 -06:00
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_statuest>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
break;
|
2017-05-25 04:08:31 -06:00
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
case df::enums::building_type::WindowGlass:
|
2017-05-25 04:08:31 -06:00
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_window_glassst>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
break;
|
2017-05-25 04:08:31 -06:00
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
case df::enums::building_type::WindowGem:
|
2017-05-25 04:08:31 -06:00
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_window_gemst>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
break;
|
2017-05-25 04:08:31 -06:00
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
case df::enums::building_type::Well:
|
2017-05-25 04:08:31 -06:00
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_wellst>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
remote_build->set_active(actual->bucket_z);
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
break;
|
2017-05-25 04:08:31 -06:00
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
case df::enums::building_type::Bridge:
|
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_bridgest>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
auto direction = actual->direction;
|
|
|
|
switch (direction)
|
|
|
|
{
|
|
|
|
case df::building_bridgest::Retracting:
|
2017-05-23 10:11:34 -06:00
|
|
|
remote_build->set_direction(NONE);
|
2017-03-25 10:53:40 -06:00
|
|
|
break;
|
|
|
|
case df::building_bridgest::Left:
|
|
|
|
remote_build->set_direction(WEST);
|
|
|
|
break;
|
|
|
|
case df::building_bridgest::Right:
|
|
|
|
remote_build->set_direction(EAST);
|
|
|
|
break;
|
|
|
|
case df::building_bridgest::Up:
|
|
|
|
remote_build->set_direction(NORTH);
|
|
|
|
break;
|
|
|
|
case df::building_bridgest::Down:
|
|
|
|
remote_build->set_direction(SOUTH);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2017-05-22 10:33:12 -06:00
|
|
|
if (actual->gate_flags.bits.closed)
|
|
|
|
remote_build->set_active(1);
|
|
|
|
else
|
|
|
|
remote_build->set_active(0);
|
2017-03-25 10:53:40 -06:00
|
|
|
}
|
2017-05-25 04:08:31 -06:00
|
|
|
break;
|
2017-03-25 10:53:40 -06:00
|
|
|
}
|
|
|
|
case df::enums::building_type::RoadDirt:
|
2017-05-25 04:08:31 -06:00
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_road_dirtst>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
break;
|
2017-05-25 04:08:31 -06:00
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
case df::enums::building_type::RoadPaved:
|
2017-05-25 04:08:31 -06:00
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_road_pavedst>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
break;
|
2017-05-25 04:08:31 -06:00
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
case df::enums::building_type::SiegeEngine:
|
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_siegeenginest>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
auto facing = actual->facing;
|
|
|
|
switch (facing)
|
|
|
|
{
|
|
|
|
case df::building_siegeenginest::Left:
|
|
|
|
remote_build->set_direction(WEST);
|
|
|
|
break;
|
|
|
|
case df::building_siegeenginest::Up:
|
|
|
|
remote_build->set_direction(NORTH);
|
|
|
|
break;
|
|
|
|
case df::building_siegeenginest::Right:
|
|
|
|
remote_build->set_direction(EAST);
|
|
|
|
break;
|
|
|
|
case df::building_siegeenginest::Down:
|
|
|
|
remote_build->set_direction(SOUTH);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2017-05-25 04:08:31 -06:00
|
|
|
break;
|
2017-03-25 10:53:40 -06:00
|
|
|
}
|
|
|
|
case df::enums::building_type::Trap:
|
2017-05-25 04:08:31 -06:00
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_trapst>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
remote_build->set_active(actual->state);
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
break;
|
2017-05-25 04:08:31 -06:00
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
case df::enums::building_type::AnimalTrap:
|
2017-05-25 04:08:31 -06:00
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_animaltrapst>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
break;
|
2017-05-25 04:08:31 -06:00
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
case df::enums::building_type::Support:
|
2017-05-25 04:08:31 -06:00
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_supportst>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
remote_build->set_active(actual->support_flags.bits.triggered);
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
break;
|
2017-05-25 04:08:31 -06:00
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
case df::enums::building_type::ArcheryTarget:
|
2017-04-05 04:05:48 -06:00
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_archerytargetst>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
auto facing = actual->archery_direction;
|
|
|
|
switch (facing)
|
|
|
|
{
|
|
|
|
case df::building_archerytargetst::TopToBottom:
|
|
|
|
remote_build->set_direction(NORTH);
|
|
|
|
break;
|
|
|
|
case df::building_archerytargetst::BottomToTop:
|
|
|
|
remote_build->set_direction(SOUTH);
|
|
|
|
break;
|
|
|
|
case df::building_archerytargetst::LeftToRight:
|
|
|
|
remote_build->set_direction(WEST);
|
|
|
|
break;
|
|
|
|
case df::building_archerytargetst::RightToLeft:
|
|
|
|
remote_build->set_direction(EAST);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
break;
|
2017-05-25 04:08:31 -06:00
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
case df::enums::building_type::Chain:
|
2017-05-25 04:08:31 -06:00
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_chainst>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
remote_build->set_active(actual->chain_flags.bits.triggered);
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
break;
|
2017-05-25 04:08:31 -06:00
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
case df::enums::building_type::Cage:
|
2017-05-25 04:08:31 -06:00
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_cagest>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
remote_build->set_active(actual->cage_flags.bits.triggered);
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
break;
|
2017-05-25 04:08:31 -06:00
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
case df::enums::building_type::Stockpile:
|
2017-05-25 04:08:31 -06:00
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_stockpilest>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
break;
|
2017-05-25 04:08:31 -06:00
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
case df::enums::building_type::Civzone:
|
2017-05-25 04:08:31 -06:00
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_civzonest>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
break;
|
2017-05-25 04:08:31 -06:00
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
case df::enums::building_type::Weapon:
|
2017-05-25 04:08:31 -06:00
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_weaponst>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
if (actual->gate_flags.bits.closed)
|
|
|
|
remote_build->set_active(1);
|
|
|
|
else
|
|
|
|
remote_build->set_active(0);
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
break;
|
2017-05-25 04:08:31 -06:00
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
case df::enums::building_type::Wagon:
|
2017-05-25 04:08:31 -06:00
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_wagonst>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
break;
|
2017-05-25 04:08:31 -06:00
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
case df::enums::building_type::ScrewPump:
|
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_screw_pumpst>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
auto direction = actual->direction;
|
|
|
|
switch (direction)
|
|
|
|
{
|
|
|
|
case df::enums::screw_pump_direction::FromNorth:
|
|
|
|
remote_build->set_direction(NORTH);
|
|
|
|
break;
|
|
|
|
case df::enums::screw_pump_direction::FromEast:
|
|
|
|
remote_build->set_direction(EAST);
|
|
|
|
break;
|
|
|
|
case df::enums::screw_pump_direction::FromSouth:
|
|
|
|
remote_build->set_direction(SOUTH);
|
|
|
|
break;
|
|
|
|
case df::enums::screw_pump_direction::FromWest:
|
|
|
|
remote_build->set_direction(WEST);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2017-05-25 04:08:31 -06:00
|
|
|
if (actual->machine.machine_id >= 0)
|
|
|
|
{
|
|
|
|
auto mach = df::machine::find(actual->machine.machine_id);
|
|
|
|
remote_build->set_active(mach->flags.bits.active);
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::Construction:
|
2017-05-25 04:08:31 -06:00
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_constructionst>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
break;
|
2017-05-25 04:08:31 -06:00
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
case df::enums::building_type::Hatch:
|
2017-05-25 04:08:31 -06:00
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_hatchst>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
if (actual->door_flags.bits.closed)
|
|
|
|
remote_build->set_active(1);
|
|
|
|
else
|
|
|
|
remote_build->set_active(0);
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
break;
|
2017-05-25 04:08:31 -06:00
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
case df::enums::building_type::GrateWall:
|
2017-05-25 04:08:31 -06:00
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_grate_wallst>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
if (actual->gate_flags.bits.closed)
|
|
|
|
remote_build->set_active(1);
|
|
|
|
else
|
|
|
|
remote_build->set_active(0);
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
break;
|
2017-05-25 04:08:31 -06:00
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
case df::enums::building_type::GrateFloor:
|
2017-05-25 04:08:31 -06:00
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_grate_floorst>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
if (actual->gate_flags.bits.closed)
|
|
|
|
remote_build->set_active(1);
|
|
|
|
else
|
|
|
|
remote_build->set_active(0);
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
break;
|
2017-05-25 04:08:31 -06:00
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
case df::enums::building_type::BarsVertical:
|
2017-05-25 04:08:31 -06:00
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_bars_verticalst>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
if (actual->gate_flags.bits.closed)
|
|
|
|
remote_build->set_active(1);
|
|
|
|
else
|
|
|
|
remote_build->set_active(0);
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
break;
|
2017-05-25 04:08:31 -06:00
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
case df::enums::building_type::BarsFloor:
|
2017-05-25 04:08:31 -06:00
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_bars_floorst>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
if (actual->gate_flags.bits.closed)
|
|
|
|
remote_build->set_active(1);
|
|
|
|
else
|
|
|
|
remote_build->set_active(0);
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
break;
|
2017-05-25 04:08:31 -06:00
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
case df::enums::building_type::GearAssembly:
|
2017-05-25 04:08:31 -06:00
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_gear_assemblyst>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
if (actual->machine.machine_id >= 0)
|
|
|
|
{
|
|
|
|
auto mach = df::machine::find(actual->machine.machine_id);
|
|
|
|
remote_build->set_active(mach->flags.bits.active);
|
|
|
|
}
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
break;
|
2017-05-25 04:08:31 -06:00
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
case df::enums::building_type::AxleHorizontal:
|
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_axle_horizontalst>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
if (actual->is_vertical)
|
|
|
|
remote_build->set_direction(NORTH);
|
|
|
|
else
|
|
|
|
remote_build->set_direction(EAST);
|
2017-05-25 04:08:31 -06:00
|
|
|
if (actual->machine.machine_id >= 0)
|
|
|
|
{
|
|
|
|
auto mach = df::machine::find(actual->machine.machine_id);
|
|
|
|
remote_build->set_active(mach->flags.bits.active);
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::AxleVertical:
|
2017-05-25 04:08:31 -06:00
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_axle_verticalst>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
if (actual->machine.machine_id >= 0)
|
|
|
|
{
|
|
|
|
auto mach = df::machine::find(actual->machine.machine_id);
|
|
|
|
remote_build->set_active(mach->flags.bits.active);
|
|
|
|
}
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
break;
|
2017-05-25 04:08:31 -06:00
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
case df::enums::building_type::WaterWheel:
|
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_water_wheelst>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
if (actual->is_vertical)
|
|
|
|
remote_build->set_direction(NORTH);
|
|
|
|
else
|
|
|
|
remote_build->set_direction(EAST);
|
2017-05-25 04:08:31 -06:00
|
|
|
if (actual->machine.machine_id >= 0)
|
|
|
|
{
|
|
|
|
auto mach = df::machine::find(actual->machine.machine_id);
|
|
|
|
remote_build->set_active(mach->flags.bits.active);
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::Windmill:
|
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_windmillst>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
2017-07-04 09:40:59 -06:00
|
|
|
#if DF_VERSION_INT > 34011
|
2017-03-25 10:53:40 -06:00
|
|
|
if (actual->orient_x < 0)
|
|
|
|
remote_build->set_direction(WEST);
|
|
|
|
else if (actual->orient_x > 0)
|
|
|
|
remote_build->set_direction(EAST);
|
|
|
|
else if (actual->orient_y < 0)
|
|
|
|
remote_build->set_direction(NORTH);
|
|
|
|
else if (actual->orient_y > 0)
|
|
|
|
remote_build->set_direction(SOUTH);
|
|
|
|
else
|
2017-07-04 09:40:59 -06:00
|
|
|
#endif
|
2017-03-25 10:53:40 -06:00
|
|
|
remote_build->set_direction(WEST);
|
2017-05-25 04:08:31 -06:00
|
|
|
if (actual->machine.machine_id >= 0)
|
|
|
|
{
|
|
|
|
auto mach = df::machine::find(actual->machine.machine_id);
|
|
|
|
remote_build->set_active(mach->flags.bits.active);
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::TractionBench:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::Slab:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::Nest:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::NestBox:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::Hive:
|
|
|
|
break;
|
|
|
|
case df::enums::building_type::Rollers:
|
|
|
|
{
|
|
|
|
auto actual = strict_virtual_cast<df::building_rollersst>(local_build);
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
auto direction = actual->direction;
|
|
|
|
switch (direction)
|
|
|
|
{
|
|
|
|
case df::enums::screw_pump_direction::FromNorth:
|
|
|
|
remote_build->set_direction(NORTH);
|
|
|
|
break;
|
|
|
|
case df::enums::screw_pump_direction::FromEast:
|
|
|
|
remote_build->set_direction(EAST);
|
|
|
|
break;
|
|
|
|
case df::enums::screw_pump_direction::FromSouth:
|
|
|
|
remote_build->set_direction(SOUTH);
|
|
|
|
break;
|
|
|
|
case df::enums::screw_pump_direction::FromWest:
|
|
|
|
remote_build->set_direction(WEST);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2017-05-25 04:08:31 -06:00
|
|
|
if (actual->machine.machine_id >= 0)
|
|
|
|
{
|
|
|
|
auto mach = df::machine::find(actual->machine.machine_id);
|
|
|
|
remote_build->set_active(mach->flags.bits.active);
|
|
|
|
}
|
2017-03-25 10:53:40 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|