Constructions module: remove some old/unused functions/types

develop
lethosor 2022-06-28 23:44:34 -04:00
parent 4c7caa2658
commit 1147add520
No known key found for this signature in database
GPG Key ID: 76A269552F4F58C1
3 changed files with 1 additions and 49 deletions

@ -50,6 +50,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences:
- Removed ``Engravings`` module (C++-only). Access ``world.engravings`` directly instead.
- Removed ``Notes`` module (C++-only). Access ``ui.waypoints.points`` directly instead.
- Removed ``Windows`` module (C++-only) - unused.
- ``Constructions`` module (C++-only): removed ``t_construction``, ``isValid()``, ``getCount()``, ``getConstruction()``, and ``copyConstruction()``. Access ``world.constructions`` directly instead.
## Lua
- ``tile-material``: fix the order of declarations. The ``GetTileMat`` function now returns the material as intended (always returned nil before). Also changed the license info, with permission of the original author.

@ -42,23 +42,7 @@ namespace DFHack
{
namespace Constructions
{
// "Simplified" copy of construction
struct t_construction {
df::coord pos;
df::item_type item_type;
int16_t item_subtype;
int16_t mat_type;
int32_t mat_index;
df::construction_flags flags;
int16_t original_tile;
// Pointer to original object, in case you want to modify it
df::construction *origin;
};
DFHACK_EXPORT bool isValid();
DFHACK_EXPORT uint32_t getCount();
DFHACK_EXPORT bool copyConstruction (const int32_t index, t_construction &out);
DFHACK_EXPORT df::construction * getConstruction (const int32_t index);
DFHACK_EXPORT df::construction * findAtTile(df::coord pos);
DFHACK_EXPORT bool designateNew(df::coord pos, df::construction_type type,

@ -51,22 +51,6 @@ using namespace DFHack;
using namespace df::enums;
using df::global::world;
bool Constructions::isValid()
{
return (world != NULL);
}
uint32_t Constructions::getCount()
{
return world->constructions.size();
}
df::construction * Constructions::getConstruction(const int32_t index)
{
if (uint32_t(index) >= getCount())
return NULL;
return world->constructions[index];
}
df::construction * Constructions::findAtTile(df::coord pos)
{
@ -77,23 +61,6 @@ df::construction * Constructions::findAtTile(df::coord pos)
return NULL;
}
bool Constructions::copyConstruction(const int32_t index, t_construction &out)
{
if (uint32_t(index) >= getCount())
return false;
out.origin = world->constructions[index];
out.pos = out.origin->pos;
out.item_type = out.origin->item_type;
out.item_subtype = out.origin->item_subtype;
out.mat_type = out.origin->mat_type;
out.mat_index = out.origin->mat_index;
out.flags = out.origin->flags;
out.original_tile = out.origin->original_tile;
return true;
}
bool Constructions::designateNew(df::coord pos, df::construction_type type,
df::item_type item, int mat_index)
{