]> git.tdb.fi Git - poefilter.git/blob - source/category.h
Initial version from when I last played
[poefilter.git] / source / category.h
1 #ifndef CATEGORY_H_
2 #define CATEGORY_H_
3
4 #include <list>
5 #include <string>
6 #include <msp/datafile/objectloader.h>
7 #include "condition.h"
8 #include "rarity.h"
9
10 class FilterStatement;
11 class Theme;
12
13 class Category
14 {
15 public:
16         class Loader: public Msp::DataFile::ObjectLoader<Category>
17         {
18         private:
19                 CompoundCondition *compound;
20
21         public:
22                 Loader(Category &, CompoundCondition * = 0);
23
24         protected:
25                 template<typename T>
26                 void add_range(const std::string &);
27
28                 void add_condition(Condition *);
29
30         private:
31                 void and_();
32
33                 template<typename T>
34                 void condition(typename T::Type);
35
36                 template<typename T>
37                 void condition_max(typename T::Type);
38
39                 template<typename T>
40                 void condition_min(typename T::Type);
41
42                 template<typename T>
43                 void condition_range(typename T::Type, typename T::Type);
44
45                 void linked_colors(const LinkedColorsCondition::Colors &);
46                 void or_();
47         };
48
49 private:
50         Condition *condition;
51         float font_size;
52         std::string border_color;
53         unsigned order;
54         unsigned sound_type;
55         unsigned sound_volume;
56
57 public:
58         Category();
59         Category(const Category &);
60         Category &operator=(const Category &);
61         ~Category();
62
63         unsigned get_order() const { return order; }
64         void create_statements(std::list<FilterStatement> &, const Theme &) const;
65 };
66
67 #endif