#pragma once #include #include #include #include "Area.h" class Item; class BlockFilter; class PlaceableProof : public Framework::ReferenceCounter { public: PlaceableProof(); virtual bool isPlacable( const Item* item, Framework::Vec3 pos, int dimensionId) = 0; }; class PlaceableProofAnd : public PlaceableProof { private: Framework::RCArray proofs; public: PlaceableProofAnd(); bool isPlacable( const Item* item, Framework::Vec3 pos, int dimensionId) override; void addProof(PlaceableProof* proof); const Framework::RCArray& getProofs() const; }; class PlaceableProofAndFactory : public SubTypeFactory { public: PlaceableProofAndFactory(); PlaceableProofAnd* createValue( Framework::JSON::JSONObject* zJson) const override; void fromJson(PlaceableProofAnd* zResult, Framework::JSON::JSONObject* zJson) const override; void toJson(PlaceableProofAnd* zObject, Framework::JSON::JSONObject* zResult) const override; JSONObjectValidationBuilder* addToValidator( JSONObjectValidationBuilder* builder) const override; Framework::Text getTypeToken() const override; }; class PlaceableProofOr : public PlaceableProof { private: Framework::RCArray proofs; public: PlaceableProofOr(); bool isPlacable( const Item* item, Framework::Vec3 pos, int dimensionId) override; void addProof(PlaceableProof* proof); const Framework::RCArray& getProofs() const; }; class PlaceableProofOrFactory : public SubTypeFactory { public: PlaceableProofOrFactory(); PlaceableProofOr* createValue( Framework::JSON::JSONObject* zJson) const override; void fromJson(PlaceableProofOr* zResult, Framework::JSON::JSONObject* zJson) const override; void toJson(PlaceableProofOr* zObject, Framework::JSON::JSONObject* zResult) const override; JSONObjectValidationBuilder* addToValidator( JSONObjectValidationBuilder* builder) const override; Framework::Text getTypeToken() const override; }; class PlaceableProofNot : public PlaceableProof { private: PlaceableProof* proof; public: PlaceableProofNot(); ~PlaceableProofNot(); bool isPlacable( const Item* item, Framework::Vec3 pos, int dimensionId) override; void setProof(PlaceableProof* proof); PlaceableProof* zProof() const; }; class PlaceableProofNotFactory : public SubTypeFactory { public: PlaceableProofNotFactory(); PlaceableProofNot* createValue( Framework::JSON::JSONObject* zJson) const override; void fromJson(PlaceableProofNot* zResult, Framework::JSON::JSONObject* zJson) const override; void toJson(PlaceableProofNot* zObject, Framework::JSON::JSONObject* zResult) const override; JSONObjectValidationBuilder* addToValidator( JSONObjectValidationBuilder* builder) const override; Framework::Text getTypeToken() const override; }; class PlaceableProofBlockFilter : public PlaceableProof { private: Direction direction; int distance; BlockFilter* filter; public: PlaceableProofBlockFilter(); ~PlaceableProofBlockFilter(); bool isPlacable( const Item* item, Framework::Vec3 pos, int dimensionId) override; void setDirection(Direction direction); Direction getDirection() const; void setDistance(int distance); int getDistance() const; void setFilter(BlockFilter* filter); BlockFilter* zFilter() const; }; class PlaceableProofBlockFilterFactory : public SubTypeFactory { public: PlaceableProofBlockFilterFactory(); PlaceableProofBlockFilter* createValue( Framework::JSON::JSONObject* zJson) const override; void fromJson(PlaceableProofBlockFilter* zResult, Framework::JSON::JSONObject* zJson) const override; void toJson(PlaceableProofBlockFilter* zObject, Framework::JSON::JSONObject* zResult) const override; JSONObjectValidationBuilder* addToValidator( JSONObjectValidationBuilder* builder) const override; Framework::Text getTypeToken() const override; }; // TODO: add item Filter