123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- #pragma once
- #include <Array.h>
- #include <TypeRegistry.h>
- #include <Vec3.h>
- #include "Area.h"
- class Item;
- class BlockFilter;
- class PlaceableProof : public Framework::ReferenceCounter
- {
- public:
- PlaceableProof();
- virtual bool isPlacable(
- const Item* item, Framework::Vec3<float> pos, int dimensionId)
- = 0;
- };
- class PlaceableProofAnd : public PlaceableProof
- {
- private:
- Framework::RCArray<PlaceableProof> proofs;
- public:
- PlaceableProofAnd();
- bool isPlacable(
- const Item* item, Framework::Vec3<float> pos, int dimensionId) override;
- void addProof(PlaceableProof* proof);
- const Framework::RCArray<PlaceableProof>& getProofs() const;
- };
- class PlaceableProofAndFactory
- : public SubTypeFactory<PlaceableProof, PlaceableProofAnd>
- {
- 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<PlaceableProof> proofs;
- public:
- PlaceableProofOr();
- bool isPlacable(
- const Item* item, Framework::Vec3<float> pos, int dimensionId) override;
- void addProof(PlaceableProof* proof);
- const Framework::RCArray<PlaceableProof>& getProofs() const;
- };
- class PlaceableProofOrFactory
- : public SubTypeFactory<PlaceableProof, PlaceableProofOr>
- {
- 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<float> pos, int dimensionId) override;
- void setProof(PlaceableProof* proof);
- PlaceableProof* zProof() const;
- };
- class PlaceableProofNotFactory
- : public SubTypeFactory<PlaceableProof, PlaceableProofNot>
- {
- 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<float> 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<PlaceableProof, PlaceableProofBlockFilter>
- {
- 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
|