Apply r3 name changes

develop
Anuradha Dissanayake 2013-03-16 18:25:02 +13:00
parent b961cb6a09
commit c16bd3d71a
5 changed files with 11 additions and 13 deletions

@ -1 +1 @@
Subproject commit 2f76de54dacd32af567b177adfb9d037fdf62d9b Subproject commit 4d2afc3a0bcebdb17415dc2827b44fd35986a368

@ -478,7 +478,7 @@ public:
this->building = building; this->building = building;
this->filter = *filter; this->filter = *filter;
pos = df::coord(building->centerx, building->centery, building->z); pos = df::coord(building->centerx, building->centery, building->z);
config = Core::getInstance().getWorld()->AddPersistentData("buildingplan/constraints"); config = DFHack::World::AddPersistentData("buildingplan/constraints");
config.val() = filter->getMaterialFilterAsSerial(); config.val() = filter->getMaterialFilterAsSerial();
config.ival(1) = building->id; config.ival(1) = building->id;
config.ival(2) = filter->min_quality + 1; config.ival(2) = filter->min_quality + 1;
@ -606,7 +606,7 @@ public:
void remove() void remove()
{ {
Core::getInstance().getWorld()->DeletePersistentData(config); DFHack::World::DeletePersistentData(config);
} }
private: private:
@ -637,9 +637,8 @@ public:
void reset(color_ostream &out) void reset(color_ostream &out)
{ {
planned_buildings.clear(); planned_buildings.clear();
auto pworld = Core::getInstance().getWorld();
std::vector<PersistentDataItem> items; std::vector<PersistentDataItem> items;
pworld->GetPersistentData(&items, "buildingplan/constraints"); DFHack::World::GetPersistentData(&items, "buildingplan/constraints");
for (auto i = items.begin(); i != items.end(); i++) for (auto i = items.begin(); i != items.end(); i++)
{ {
@ -842,10 +841,10 @@ private:
#define F(x) bad_flags.bits.x = true; #define F(x) bad_flags.bits.x = true;
F(dump); F(forbid); F(garbage_collect); F(dump); F(forbid); F(garbage_collect);
F(hostile); F(on_fire); F(rotten); F(trader); F(hostile); F(on_fire); F(rotten); F(trader);
F(in_building); F(construction); F(artifact1); F(in_building); F(construction); F(artifact);
#undef F #undef F
std::vector<df::item*> &items = world->items.other[items_other_id::ANY_FREE]; std::vector<df::item*> &items = world->items.other[items_other_id::IN_PLAY];
for (size_t i = 0; i < items.size(); i++) for (size_t i = 0; i < items.size(); i++)
{ {
@ -861,7 +860,7 @@ private:
if (itype == item_type::BOX && item->isBag()) if (itype == item_type::BOX && item->isBag())
continue; //Skip bags continue; //Skip bags
if (item->flags.bits.artifact1 || item->flags.bits.artifact2) if (item->flags.bits.artifact)
continue; continue;
if (item->flags.bits.in_job || if (item->flags.bits.in_job ||

@ -1107,7 +1107,7 @@ DFhackCExport command_result plugin_onupdate (color_ostream &out)
static decltype(world->frame_counter) last_frame_count = 0; static decltype(world->frame_counter) last_frame_count = 0;
bool is_paused = Core::getInstance().getWorld()->ReadPauseState(); bool is_paused = DFHack::World::ReadPauseState();
if (is_paused) if (is_paused)
{ {
if (monitor_misery && !misery_upto_date) if (monitor_misery && !misery_upto_date)

@ -220,8 +220,7 @@ struct resume_hook : public df::viewscreen_dwarfmodest
{ {
INTERPOSE_NEXT(render)(); INTERPOSE_NEXT(render)();
DFHack::World *world = Core::getInstance().getWorld(); if (enabled && DFHack::World::ReadPauseState() && ui->main.mode == ui_sidebar_mode::Default)
if (enabled && world->ReadPauseState() && ui->main.mode == ui_sidebar_mode::Default)
{ {
scan_for_suspended_buildings(); scan_for_suspended_buildings();
show_suspended_buildings(); show_suspended_buildings();

@ -1005,9 +1005,9 @@ bool isAssigned(df::unit* unit)
bool isAssignedToZone(df::unit* unit) bool isAssignedToZone(df::unit* unit)
{ {
bool assigned = false; bool assigned = false;
for (size_t r=0; r < unit->refs.size(); r++) for (size_t r=0; r < unit->general_refs.size(); r++)
{ {
df::general_ref * ref = unit->refs[r]; df::general_ref * ref = unit->general_refs[r];
auto rtype = ref->getType(); auto rtype = ref->getType();
if(rtype == df::general_ref_type::BUILDING_CIVZONE_ASSIGNED) if(rtype == df::general_ref_type::BUILDING_CIVZONE_ASSIGNED)
{ {