X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fcategory.cpp;h=fb12fec0ddfd25fa0dc14996b80e780af62507ae;hb=1805b8e549e6b5c0a53b2f735b8f2eb725f40b2e;hp=4ceed1883df32f7e971bd8dcb594795f64fa831c;hpb=0388bdcffe5c2c3e720afa9aa911268eac9c32de;p=poefilter.git diff --git a/source/category.cpp b/source/category.cpp index 4ceed18..fb12fec 100644 --- a/source/category.cpp +++ b/source/category.cpp @@ -8,12 +8,17 @@ using namespace std; using namespace Msp; -Category::Category(const string &n): - name(n), +Category::Category(): condition(0), order(0) { } +Category::Category(const string &n, unsigned o): + name(n), + condition(0), + order(o) +{ } + Category::Category(const Category &other): name(other.name), condition(other.condition ? other.condition->clone() : 0), @@ -54,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"); @@ -62,7 +68,6 @@ Category::Loader::Loader(Category &c, const PoeFilter &p, CompoundCondition *n): add_range("linked_sockets"); add_range("sockets"); add("or", &Loader::or_); - add("order", &Category::order); add_range("quality"); add_range("rarity"); add_range("width"); @@ -102,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) {