#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* fromJson( Framework::JSON::JSONObject* zJson) const override; Framework::JSON::JSONObject* toJsonObject( PlaceableProofAnd* zObject) const override; JSONObjectValidationBuilder* addToValidator( JSONObjectValidationBuilder* builder) const override; const char* 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* fromJson( Framework::JSON::JSONObject* zJson) const override; Framework::JSON::JSONObject* toJsonObject( PlaceableProofOr* zObject) const override; JSONObjectValidationBuilder* addToValidator( JSONObjectValidationBuilder* builder) const override; const char* 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* fromJson( Framework::JSON::JSONObject* zJson) const override; Framework::JSON::JSONObject* toJsonObject( PlaceableProofNot* zObject) const override; JSONObjectValidationBuilder* addToValidator( JSONObjectValidationBuilder* builder) const override; const char* 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* fromJson( Framework::JSON::JSONObject* zJson) const override; Framework::JSON::JSONObject* toJsonObject( PlaceableProofBlockFilter* zObject) const override; JSONObjectValidationBuilder* addToValidator( JSONObjectValidationBuilder* builder) const override; const char* getTypeToken() const override; }; // TODO: add item Filter