about summary refs log tree commit diff stats
path: root/data/maps/the_orb/rooms/R Room.txtpb
blob: a01726af65777098ed4ecb0308aa3288059e5d01 (plain) (blame)
1
2
3
4
5
name: "R Room"
letters {
  key: "r"
  path: "Components/Collectables/r"
}
nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#ifndef FILTER_H_932BA9C6
#define FILTER_H_932BA9C6

#include <list>
#include <string>
#include <memory>
#include "field.h"
#include "enums.h"

namespace verbly {

  class filter {
  public:
    enum class type {
      empty,
      singleton,
      group
    };

    enum class comparison {
      int_equals,
      int_does_not_equal,
      int_is_at_least,
      int_is_greater_than,
      int_is_at_most,
      int_is_less_than,
      boolean_equals,
      string_equals,
      string_does_not_equal,
      string_is_like,
      string_is_not_like,
      is_null,
      is_not_null,
      matches,
      does_not_match,
      hierarchally_matches,
      does_not_hierarchally_match
    };

    // Copy and move constructors

    filter(const filter& other);
    filter(filter&& other);

    // Assignment

    filter& operator=(filter other);

    // Swap

    friend void swap(filter& first, filter& second);

    // Destructor

    ~filter();

    // Accessors

    type getType() const
    {
      return type_;
    }

    // Empty

    filter();

    // Singleton

    filter(field filterField, comparison filterType, int filterValue);
    filter(field filterField, comparison filterType, std::string filterValue);
    filter(field filterField, comparison filterType, bool filterValue);
    filter(field filterField, comparison filterType);
    filter(field joinOn, comparison filterType, filter joinCondition);

    field getField() const;

    comparison getComparison() const;

    filter getJoinCondition() const;

    std::string getStringArgument() const;

    int getIntegerArgument() const;

    bool getBooleanArgument() const;

    // Group

    explicit filter(bool orlogic);

    bool getOrlogic() const;

    filter operator+(filter condition) const;

    filter& operator+=(filter condition);

    using const_iterator = std::list<filter>::const_iterator;

    const_iterator begin() const;

    const_iterator end() const;

    // Negation

    filter operator!() const;

    // Groupifying

    filter operator&&(filter condition) const;
    filter operator||(filter condition) const;

    filter& operator&=(filter condition);
    filter& operator|=(filter condition);

    // Utility

    filter normalize(object context) const;

    filter compact() const;

  private:
    union {
      struct {
        field filterField;
        comparison filterType;
        union {
          std::unique_ptr<filter> join;
          std::string stringValue;
          int intValue;
          bool boolValue;
        };
      } singleton_;
      struct {
        std::list<filter> children;
        bool orlogic;
      } group_;
    };
    type type_ = type::empty;

  };

};

#endif /* end of include guard: FILTER_H_932BA9C6 */