#pragma once #include #include "TypeRegistry.h" class Block; class BlockFilter : public Framework::ReferenceCounter { public: BlockFilter(); virtual bool test(const Block* zBlock) = 0; }; class BlockFilterAnd : public BlockFilter { private: Framework::RCArray filters; public: BlockFilterAnd(); bool test(const Block* zBlock) override; void addFilter(BlockFilter* filter); Framework::RCArray getFilters() const; }; class BlockFilterAndFactory : public SubTypeFactory { public: BlockFilterAndFactory(); BlockFilterAnd* fromJson(Framework::JSON::JSONObject* zJson) const override; Framework::JSON::JSONObject* toJsonObject( BlockFilterAnd* zObject) const override; JSONObjectValidationBuilder* addToValidator( JSONObjectValidationBuilder* builder) const override; const char* getTypeToken() const override; }; class BlockFilterOr : public BlockFilter { private: Framework::RCArray filters; public: BlockFilterOr(); bool test(const Block* zBlock) override; void addFilter(BlockFilter* filter); Framework::RCArray getFilters() const; }; class BlockFilterOrFactory : public SubTypeFactory { public: BlockFilterOrFactory(); BlockFilterOr* fromJson(Framework::JSON::JSONObject* zJson) const override; Framework::JSON::JSONObject* toJsonObject( BlockFilterOr* zObject) const override; JSONObjectValidationBuilder* addToValidator( JSONObjectValidationBuilder* builder) const override; const char* getTypeToken() const override; }; class BlockFilterNot : public BlockFilter { private: BlockFilter* filter; public: BlockFilterNot(); ~BlockFilterNot(); bool test(const Block* zBlock) override; void setFilter(BlockFilter* filter); BlockFilter* zFilter() const; }; class BlockFilterNotFactory : public SubTypeFactory { public: BlockFilterNotFactory(); BlockFilterNot* fromJson(Framework::JSON::JSONObject* zJson) const override; Framework::JSON::JSONObject* toJsonObject( BlockFilterNot* zObject) const override; JSONObjectValidationBuilder* addToValidator( JSONObjectValidationBuilder* builder) const override; const char* getTypeToken() const override; }; class BlockFilterBlockType : public BlockFilter { private: Framework::Array blockTypeIds; public: BlockFilterBlockType(); bool test(const Block* zBlock) override; void addBlockTypeId(int blockTypeId); const Framework::Array& getBlockTypeIds() const; }; class BlockFilterBlockTypeFactory : public SubTypeFactory { public: BlockFilterBlockTypeFactory(); BlockFilterBlockType* fromJson( Framework::JSON::JSONObject* zJson) const override; Framework::JSON::JSONObject* toJsonObject( BlockFilterBlockType* zObject) const override; JSONObjectValidationBuilder* addToValidator( JSONObjectValidationBuilder* builder) const override; const char* getTypeToken() const override; }; class BlockFilterTypeGroup : public BlockFilter { private: Framework::RCArray groupNames; public: BlockFilterTypeGroup(); bool test(const Block* zBlock) override; void addGroupName(const Framework::Text groupName); const Framework::RCArray& getGroupNames() const; }; class BlockFilterTypeGroupFactory : public SubTypeFactory { public: BlockFilterTypeGroupFactory(); BlockFilterTypeGroup* fromJson( Framework::JSON::JSONObject* zJson) const override; Framework::JSON::JSONObject* toJsonObject( BlockFilterTypeGroup* zObject) const override; JSONObjectValidationBuilder* addToValidator( JSONObjectValidationBuilder* builder) const override; const char* getTypeToken() const override; }; class BlockFilterMaxHardness : public BlockFilter { private: float maxHardness; public: BlockFilterMaxHardness(); bool test(const Block* zBlock) override; void setMaxHardness(float maxHardness); float getMaxHardness() const; }; class BlockFilterMaxHardnessFactory : public SubTypeFactory { public: BlockFilterMaxHardnessFactory(); BlockFilterMaxHardness* fromJson( Framework::JSON::JSONObject* zJson) const override; Framework::JSON::JSONObject* toJsonObject( BlockFilterMaxHardness* zObject) const override; JSONObjectValidationBuilder* addToValidator( JSONObjectValidationBuilder* builder) const override; const char* getTypeToken() const override; }; class BlockFilterMinHardness : public BlockFilter { private: float minHardness; public: BlockFilterMinHardness(); bool test(const Block* zBlock) override; void setMinHardness(float minHardness); float getMinHardness() const; }; class BlockFilterMinHardnessFactory : public SubTypeFactory { public: BlockFilterMinHardnessFactory(); BlockFilterMinHardness* fromJson( Framework::JSON::JSONObject* zJson) const override; Framework::JSON::JSONObject* toJsonObject( BlockFilterMinHardness* zObject) const override; JSONObjectValidationBuilder* addToValidator( JSONObjectValidationBuilder* builder) const override; const char* getTypeToken() const override; }; class BlockFilterMaxHeat : public BlockFilter { private: float maxHeat; public: BlockFilterMaxHeat(); bool test(const Block* zBlock) override; void setMaxHeat(float maxHeat); float getMaxHeat() const; }; class BlockFilterMaxHeatFactory : public SubTypeFactory { public: BlockFilterMaxHeatFactory(); BlockFilterMaxHeat* fromJson( Framework::JSON::JSONObject* zJson) const override; Framework::JSON::JSONObject* toJsonObject( BlockFilterMaxHeat* zObject) const override; JSONObjectValidationBuilder* addToValidator( JSONObjectValidationBuilder* builder) const override; const char* getTypeToken() const override; };