2023-02-13 19:45:26 -07:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "modules/Persistence.h"
|
|
|
|
|
2023-02-19 01:57:30 -07:00
|
|
|
#include "df/building.h"
|
2023-02-15 17:54:38 -07:00
|
|
|
#include "df/job_item.h"
|
2023-02-13 19:45:26 -07:00
|
|
|
#include "df/job_item_vector_id.h"
|
|
|
|
|
|
|
|
#include <deque>
|
|
|
|
|
|
|
|
typedef std::deque<std::pair<int32_t, int>> Bucket;
|
|
|
|
typedef std::map<df::job_item_vector_id, std::map<std::string, Bucket>> Tasks;
|
|
|
|
|
|
|
|
extern const std::string BLD_CONFIG_KEY;
|
|
|
|
|
|
|
|
enum ConfigValues {
|
|
|
|
CONFIG_BLOCKS = 1,
|
|
|
|
CONFIG_BOULDERS = 2,
|
|
|
|
CONFIG_LOGS = 3,
|
|
|
|
CONFIG_BARS = 4,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum BuildingConfigValues {
|
|
|
|
BLD_CONFIG_ID = 0,
|
2023-02-19 01:57:30 -07:00
|
|
|
BLD_CONFIG_HEAT = 1,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum HeatSafety {
|
|
|
|
HEAT_SAFETY_ANY = 0,
|
|
|
|
HEAT_SAFETY_FIRE = 1,
|
|
|
|
HEAT_SAFETY_MAGMA = 2,
|
2023-02-13 19:45:26 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
int get_config_val(DFHack::PersistentDataItem &c, int index);
|
|
|
|
bool get_config_bool(DFHack::PersistentDataItem &c, int index);
|
|
|
|
void set_config_val(DFHack::PersistentDataItem &c, int index, int value);
|
|
|
|
void set_config_bool(DFHack::PersistentDataItem &c, int index, bool value);
|
2023-02-15 17:54:38 -07:00
|
|
|
|
2023-02-15 20:10:42 -07:00
|
|
|
std::vector<df::job_item_vector_id> getVectorIds(DFHack::color_ostream &out, df::job_item *job_item);
|
2023-02-15 17:54:38 -07:00
|
|
|
bool itemPassesScreen(df::item * item);
|
2023-02-19 01:57:30 -07:00
|
|
|
bool matchesFilters(df::item * item, df::job_item * job_item, HeatSafety heat);
|
2023-02-17 20:16:45 -07:00
|
|
|
bool isJobReady(DFHack::color_ostream &out, const std::vector<df::job_item *> &jitems);
|
|
|
|
void finalizeBuilding(DFHack::color_ostream &out, df::building *bld);
|