Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 0 additions & 33 deletions library/include/modules/Buildings.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,46 +58,13 @@ class color_ostream;

namespace Buildings
{
/**
* Structure for holding a read DF building object
* \ingroup grp_buildings
*/
struct t_building
{
uint32_t x1;
uint32_t y1;
uint32_t x2;
uint32_t y2;
uint32_t z;
t_matglossPair material;
df::building_type type;
union
{
int16_t subtype;
df::civzone_type civzone_type;
df::furnace_type furnace_type;
df::workshop_type workshop_type;
df::construction_type construction_type;
df::shop_type shop_type;
df::siegeengine_type siegeengine_type;
df::trap_type trap_type;
};
int32_t custom_type;
df::building * origin;
};

/**
* The Buildings module - allows reading DF buildings
* \ingroup grp_modules
* \ingroup grp_buildings
*/
DFHACK_EXPORT uint32_t getNumBuildings ();

/**
* read building by index
*/
DFHACK_EXPORT bool Read (const uint32_t index, t_building & building);

/**
* read mapping from custom_type value to building RAW name
* custom_type of -1 implies ordinary building
Expand Down
18 changes: 0 additions & 18 deletions library/modules/Buildings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,24 +278,6 @@ uint32_t Buildings::getNumBuildings()
return world->buildings.all.size();
}

bool Buildings::Read (const uint32_t index, t_building & building)
{
df::building *bld = world->buildings.all[index];

building.x1 = bld->x1;
building.x2 = bld->x2;
building.y1 = bld->y1;
building.y2 = bld->y2;
building.z = bld->z;
building.material.index = bld->mat_index;
building.material.type = bld->mat_type;
building.type = bld->getType();
building.subtype = bld->getSubtype();
building.custom_type = bld->getCustomType();
building.origin = bld;
return true;
}

bool Buildings::ReadCustomWorkshopTypes(map <uint32_t, string> & btypes)
{
vector <building_def *> & bld_def = world->raws.buildings.all;
Expand Down
Loading