dfhack/plugins/buildingplan/plannedbuilding.h

37 lines
1.1 KiB
C

2023-02-13 19:45:26 -07:00
#pragma once
2023-02-19 01:57:30 -07:00
#include "buildingplan.h"
2023-02-21 19:05:15 -07:00
#include "itemfilter.h"
2023-02-19 01:57:30 -07:00
2023-02-13 19:45:26 -07:00
#include "Core.h"
#include "modules/Persistence.h"
#include "df/building.h"
2023-02-15 20:10:42 -07:00
#include "df/job_item_vector_id.h"
2023-02-13 19:45:26 -07:00
class PlannedBuilding {
public:
const df::building::key_field_type id;
2023-02-15 20:10:42 -07:00
// job_item idx -> list of vectors the task is linked to
const std::vector<std::vector<df::job_item_vector_id>> vector_ids;
2023-02-19 01:57:30 -07:00
const HeatSafety heat_safety;
2023-02-21 19:05:15 -07:00
const std::vector<ItemFilter> item_filters;
PlannedBuilding(DFHack::color_ostream &out, df::building *bld, HeatSafety heat, const std::vector<ItemFilter> &item_filters);
2023-02-15 20:10:42 -07:00
PlannedBuilding(DFHack::color_ostream &out, DFHack::PersistentDataItem &bld_config);
2023-02-13 19:45:26 -07:00
void remove(DFHack::color_ostream &out);
// Ensure the building still exists and is in a valid state. It can disappear
// for lots of reasons, such as running the game with the buildingplan plugin
// disabled, manually removing the building, modifying it via the API, etc.
df::building * getBuildingIfValidOrRemoveIfNot(DFHack::color_ostream &out);
private:
DFHack::PersistentDataItem bld_config;
};