RangeCondition(Type, Type);
virtual RangeCondition<T> *clone() const;
+ virtual bool equals(const Condition &) const;
virtual bool can_merge(const Condition &, const CompoundCondition &) const;
virtual RangeCondition<T> *merge(const std::vector<const Condition *> &, const CompoundCondition &) const;
virtual bool is_viable() const { return min<=max; }
typedef RangeCondition<DropLevelTraits> DropLevelCondition;
+struct MapTierTraits
+{
+ typedef unsigned Type;
+ static unsigned get_min() { return 1; }
+ static unsigned get_max() { return 17; }
+ static const char *get_keyword() { return "MapTier"; }
+};
+
+typedef RangeCondition<MapTierTraits> MapTierCondition;
+
+
struct WidthTraits
{
typedef unsigned Type;
return new RangeCondition<T>(min, max);
}
+template<typename T>
+bool RangeCondition<T>::equals(const Condition &other) const
+{
+ const RangeCondition<T> *other_range = dynamic_cast<const RangeCondition<T> *>(&other);
+ if(!other_range)
+ return false;
+
+ return (min==other_range->min && max==other_range->max);
+}
+
template<typename T>
bool RangeCondition<T>::can_merge(const Condition &other, const CompoundCondition &parent) const
{