2023-02-13 19:45:26 -07:00
|
|
|
#pragma once
|
|
|
|
|
2023-02-21 19:05:15 -07:00
|
|
|
#include "itemfilter.h"
|
|
|
|
|
2023-02-13 19:45:26 -07:00
|
|
|
#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>
|
2023-03-15 01:29:27 -06:00
|
|
|
#include <set>
|
2023-02-13 19:45:26 -07:00
|
|
|
|
|
|
|
typedef std::deque<std::pair<int32_t, int>> Bucket;
|
|
|
|
typedef std::map<df::job_item_vector_id, std::map<std::string, Bucket>> Tasks;
|
|
|
|
|
2023-02-22 16:08:11 -07:00
|
|
|
extern const std::string FILTER_CONFIG_KEY;
|
2023-02-13 19:45:26 -07:00
|
|
|
extern const std::string BLD_CONFIG_KEY;
|
|
|
|
|
|
|
|
enum ConfigValues {
|
|
|
|
CONFIG_BLOCKS = 1,
|
|
|
|
CONFIG_BOULDERS = 2,
|
|
|
|
CONFIG_LOGS = 3,
|
|
|
|
CONFIG_BARS = 4,
|
|
|
|
};
|
|
|
|
|
2023-02-22 16:08:11 -07:00
|
|
|
enum FilterConfigValues {
|
|
|
|
FILTER_CONFIG_TYPE = 0,
|
|
|
|
FILTER_CONFIG_SUBTYPE = 1,
|
|
|
|
FILTER_CONFIG_CUSTOM = 2,
|
2023-03-14 23:26:56 -06:00
|
|
|
FILTER_CONFIG_CHOOSE_ITEMS = 3,
|
2023-02-22 16:08:11 -07:00
|
|
|
};
|
|
|
|
|
2023-02-13 19:45:26 -07:00
|
|
|
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
|
|
|
};
|
|
|
|
|
2023-03-29 00:51:52 -06:00
|
|
|
enum ItemSelectionChoice {
|
|
|
|
ITEM_SELECTION_CHOICE_FILTER = 0,
|
|
|
|
ITEM_SELECTION_CHOICE_MANUAL = 1,
|
|
|
|
ITEM_SELECTION_CHOICE_AUTOMATERIAL = 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-03-24 15:36:06 -06:00
|
|
|
std::vector<df::job_item_vector_id> getVectorIds(DFHack::color_ostream &out, const df::job_item *job_item, bool ignore_filters);
|
2023-04-26 22:01:21 -06:00
|
|
|
bool itemPassesScreen(DFHack::color_ostream& out, df::item* item);
|
2023-09-03 12:49:13 -06:00
|
|
|
bool matchesHeatSafety(int16_t mat_type, int32_t mat_index, HeatSafety heat);
|
2023-03-15 01:29:27 -06:00
|
|
|
bool matchesFilters(df::item * item, const df::job_item * job_item, HeatSafety heat, const ItemFilter &item_filter, const std::set<std::string> &special);
|
2023-02-17 20:16:45 -07:00
|
|
|
bool isJobReady(DFHack::color_ostream &out, const std::vector<df::job_item *> &jitems);
|
2023-03-27 03:24:56 -06:00
|
|
|
void finalizeBuilding(DFHack::color_ostream &out, df::building *bld, bool unsuspend_on_finalize);
|