123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236 |
- #pragma once
- #include <Array.h>
- #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<BlockFilter> filters;
- public:
- BlockFilterAnd();
- bool test(const Block* zBlock) override;
- void addFilter(BlockFilter* filter);
- Framework::RCArray<BlockFilter> getFilters() const;
- };
- class BlockFilterAndFactory : public SubTypeFactory<BlockFilter, BlockFilterAnd>
- {
- public:
- BlockFilterAndFactory();
- BlockFilterAnd* createValue(
- Framework::JSON::JSONObject* zJson) const override;
- void fromJson(BlockFilterAnd* zResult,
- Framework::JSON::JSONObject* zJson) const override;
- void toJson(BlockFilterAnd* zObject,
- Framework::JSON::JSONObject* zResult) const override;
- JSONObjectValidationBuilder* addToValidator(
- JSONObjectValidationBuilder* builder) const override;
- Framework::Text getTypeToken() const override;
- };
- class BlockFilterOr : public BlockFilter
- {
- private:
- Framework::RCArray<BlockFilter> filters;
- public:
- BlockFilterOr();
- bool test(const Block* zBlock) override;
- void addFilter(BlockFilter* filter);
- Framework::RCArray<BlockFilter> getFilters() const;
- };
- class BlockFilterOrFactory : public SubTypeFactory<BlockFilter, BlockFilterOr>
- {
- public:
- BlockFilterOrFactory();
- BlockFilterOr* createValue(
- Framework::JSON::JSONObject* zJson) const override;
- void fromJson(BlockFilterOr* zResult,
- Framework::JSON::JSONObject* zJson) const override;
- void toJson(BlockFilterOr* zObject,
- Framework::JSON::JSONObject* zResult) const override;
- JSONObjectValidationBuilder* addToValidator(
- JSONObjectValidationBuilder* builder) const override;
- Framework::Text 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<BlockFilter, BlockFilterNot>
- {
- public:
- BlockFilterNotFactory();
- BlockFilterNot* createValue(
- Framework::JSON::JSONObject* zJson) const override;
- void fromJson(BlockFilterNot* zResult,
- Framework::JSON::JSONObject* zJson) const override;
- void toJson(BlockFilterNot* zObject,
- Framework::JSON::JSONObject* zResult) const override;
- JSONObjectValidationBuilder* addToValidator(
- JSONObjectValidationBuilder* builder) const override;
- Framework::Text getTypeToken() const override;
- };
- class BlockFilterBlockType : public BlockFilter
- {
- private:
- Framework::Array<int> blockTypeIds;
- public:
- BlockFilterBlockType();
- bool test(const Block* zBlock) override;
- void addBlockTypeId(int blockTypeId);
- const Framework::Array<int>& getBlockTypeIds() const;
- };
- class BlockFilterBlockTypeFactory
- : public SubTypeFactory<BlockFilter, BlockFilterBlockType>
- {
- public:
- BlockFilterBlockTypeFactory();
- BlockFilterBlockType* createValue(
- Framework::JSON::JSONObject* zJson) const override;
- void fromJson(BlockFilterBlockType* zResult,
- Framework::JSON::JSONObject* zJson) const override;
- void toJson(BlockFilterBlockType* zObject,
- Framework::JSON::JSONObject* zResult) const override;
- JSONObjectValidationBuilder* addToValidator(
- JSONObjectValidationBuilder* builder) const override;
- Framework::Text getTypeToken() const override;
- };
- class BlockFilterTypeGroup : public BlockFilter
- {
- private:
- Framework::RCArray<Framework::Text> groupNames;
- public:
- BlockFilterTypeGroup();
- bool test(const Block* zBlock) override;
- void addGroupName(const Framework::Text groupName);
- const Framework::RCArray<Framework::Text>& getGroupNames() const;
- };
- class BlockFilterTypeGroupFactory
- : public SubTypeFactory<BlockFilter, BlockFilterTypeGroup>
- {
- public:
- BlockFilterTypeGroupFactory();
- BlockFilterTypeGroup* createValue(
- Framework::JSON::JSONObject* zJson) const override;
- void fromJson(BlockFilterTypeGroup* zResult,
- Framework::JSON::JSONObject* zJson) const override;
- void toJson(BlockFilterTypeGroup* zObject,
- Framework::JSON::JSONObject* zResult) const override;
- JSONObjectValidationBuilder* addToValidator(
- JSONObjectValidationBuilder* builder) const override;
- Framework::Text 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<BlockFilter, BlockFilterMaxHardness>
- {
- public:
- BlockFilterMaxHardnessFactory();
- BlockFilterMaxHardness* createValue(
- Framework::JSON::JSONObject* zJson) const override;
- void fromJson(BlockFilterMaxHardness* zResult,
- Framework::JSON::JSONObject* zJson) const override;
- void toJson(BlockFilterMaxHardness* zObject,
- Framework::JSON::JSONObject* zResult) const override;
- JSONObjectValidationBuilder* addToValidator(
- JSONObjectValidationBuilder* builder) const override;
- Framework::Text 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<BlockFilter, BlockFilterMinHardness>
- {
- public:
- BlockFilterMinHardnessFactory();
- BlockFilterMinHardness* createValue(
- Framework::JSON::JSONObject* zJson) const override;
- void fromJson(BlockFilterMinHardness* zResult,
- Framework::JSON::JSONObject* zJson) const override;
- void toJson(BlockFilterMinHardness* zObject,
- Framework::JSON::JSONObject* zResult) const override;
- JSONObjectValidationBuilder* addToValidator(
- JSONObjectValidationBuilder* builder) const override;
- Framework::Text 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<BlockFilter, BlockFilterMaxHeat>
- {
- public:
- BlockFilterMaxHeatFactory();
- BlockFilterMaxHeat* createValue(
- Framework::JSON::JSONObject* zJson) const override;
- void fromJson(BlockFilterMaxHeat* zResult,
- Framework::JSON::JSONObject* zJson) const override;
- void toJson(BlockFilterMaxHeat* zObject,
- Framework::JSON::JSONObject* zResult) const override;
- JSONObjectValidationBuilder* addToValidator(
- JSONObjectValidationBuilder* builder) const override;
- Framework::Text getTypeToken() const override;
- };
|