// // condition.hpp // pokemon-engine // // Created by Sam Jaffe on 7/6/22. // Copyright © 2022 Sam Jaffe. All rights reserved. // #pragma once #include #include #include #include #include #include namespace engine { class Condition { public: using Predicate = std::function; enum class Comparator { NOT_EQUAL = 0, EQUAL = 1, LESS = 2, GREATER = 4 }; private: std::string event_type_; std::vector predicates_; public: Condition() = default; Condition(std::string event_type, std::vector predicates); std::string_view event_type() const { return event_type_; } bool operator()(Event const & on) const; template static Predicate make_predicate(reflection::Property const & scope, Comparator cmp, T const & value); }; }