From 62b3368537301dd6bb6033d87000099c7adfff80 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Wed, 15 Aug 2018 18:55:47 +0300 Subject: [PATCH] Allow categories to use other categories as conditions --- source/category.cpp | 7 +++++++ source/category.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/source/category.cpp b/source/category.cpp index bb2484d..fb12fec 100644 --- a/source/category.cpp +++ b/source/category.cpp @@ -59,6 +59,7 @@ Category::Loader::Loader(Category &c, const PoeFilter &p, CompoundCondition *n): { add("and", &Loader::and_); add("base_type", &Loader::condition); + add("category", &Loader::category); add("class", &Loader::condition); add_range("drop_level"); add_range("height"); @@ -106,6 +107,12 @@ void Category::Loader::and_() add_condition(cond.release()); } +void Category::Loader::category(const string &name) +{ + const Category &categ = poe.get_category(name); + add_condition(categ.condition->clone()); +} + template void Category::Loader::condition(typename T::Type value) { diff --git a/source/category.h b/source/category.h index da4c252..2fb3084 100644 --- a/source/category.h +++ b/source/category.h @@ -34,6 +34,8 @@ public: private: void and_(); + void category(const std::string &); + template void condition(typename T::Type); -- 2.45.2