2023-02-22 16:08:11 -07:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "buildingplan.h"
|
|
|
|
#include "buildingtypekey.h"
|
|
|
|
|
|
|
|
#include "modules/Persistence.h"
|
|
|
|
|
|
|
|
class DefaultItemFilters {
|
|
|
|
public:
|
|
|
|
static BuildingTypeKey getKey(DFHack::PersistentDataItem &filter_config);
|
|
|
|
|
|
|
|
const BuildingTypeKey key;
|
|
|
|
|
|
|
|
DefaultItemFilters(DFHack::color_ostream &out, BuildingTypeKey key, const std::vector<const df::job_item *> &jitems);
|
|
|
|
DefaultItemFilters(DFHack::color_ostream &out, DFHack::PersistentDataItem &filter_config, const std::vector<const df::job_item *> &jitems);
|
|
|
|
|
2023-03-29 00:51:52 -06:00
|
|
|
void setChooseItems(int choose);
|
2023-02-22 16:08:11 -07:00
|
|
|
void setItemFilter(DFHack::color_ostream &out, const ItemFilter &filter, int index);
|
2023-03-15 01:29:27 -06:00
|
|
|
void setSpecial(const std::string &special, bool val);
|
2023-02-22 16:08:11 -07:00
|
|
|
|
2023-03-29 00:51:52 -06:00
|
|
|
int getChooseItems() const { return choose_items; }
|
2023-02-22 16:08:11 -07:00
|
|
|
const std::vector<ItemFilter> & getItemFilters() const { return item_filters; }
|
2023-03-15 01:29:27 -06:00
|
|
|
const std::set<std::string> & getSpecials() const { return specials; }
|
2023-02-22 16:08:11 -07:00
|
|
|
|
|
|
|
private:
|
|
|
|
DFHack::PersistentDataItem filter_config;
|
2023-03-29 00:51:52 -06:00
|
|
|
int choose_items;
|
2023-02-22 16:08:11 -07:00
|
|
|
std::vector<ItemFilter> item_filters;
|
2023-03-15 01:29:27 -06:00
|
|
|
std::set<std::string> specials;
|
2023-02-22 16:08:11 -07:00
|
|
|
};
|