123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- #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(Framework::RCArray<PlaceableProof> proofs);
- bool isPlacable(
- const Item* item, Framework::Vec3<float> pos, int dimensionId) override;
- const Framework::RCArray<PlaceableProof>& getProofs() const;
- };
- class PlaceableProofAndFactory
- : public SubTypeFactory<PlaceableProof, PlaceableProofAnd>
- {
- public:
- PlaceableProofAndFactory();
- PlaceableProofAnd* fromJson(
- Framework::JSON::JSONObject* zJson) const override;
- Framework::JSON::JSONObject* toJson(
- PlaceableProofAnd* zObject) const override;
- Framework::JSON::Validator::JSONValidator* getValidator(
- Framework::JSON::Validator::ObjectValidationBuilder<
- Framework::JSON::Validator::JSONValidator>* builder) const override;
- Framework::Text getTypeToken() const override;
- };
- class PlaceableProofOr : public PlaceableProof
- {
- private:
- Framework::RCArray<PlaceableProof> proofs;
- public:
- PlaceableProofOr(Framework::RCArray<PlaceableProof> proofs);
- bool isPlacable(
- const Item* item, Framework::Vec3<float> pos, int dimensionId) override;
- const Framework::RCArray<PlaceableProof>& getProofs() const;
- };
- class PlaceableProofOrFactory
- : public SubTypeFactory<PlaceableProof, PlaceableProofOr>
- {
- public:
- PlaceableProofOrFactory();
- PlaceableProofOr* fromJson(
- Framework::JSON::JSONObject* zJson) const override;
- Framework::JSON::JSONObject* toJson(
- PlaceableProofOr* zObject) const override;
- Framework::JSON::Validator::JSONValidator* getValidator(
- Framework::JSON::Validator::ObjectValidationBuilder<
- Framework::JSON::Validator::JSONValidator>* builder) const override;
- Framework::Text getTypeToken() const override;
- };
- class PlaceableProofNot : public PlaceableProof
- {
- private:
- PlaceableProof* proof;
- public:
- PlaceableProofNot(PlaceableProof* proof);
- ~PlaceableProofNot();
- bool isPlacable(
- const Item* item, Framework::Vec3<float> pos, int dimensionId) override;
- PlaceableProof* zProof() const;
- };
- class PlaceableProofNotFactory
- : public SubTypeFactory<PlaceableProof, PlaceableProofNot>
- {
- public:
- PlaceableProofNotFactory();
- PlaceableProofNot* fromJson(
- Framework::JSON::JSONObject* zJson) const override;
- Framework::JSON::JSONObject* toJson(
- PlaceableProofNot* zObject) const override;
- Framework::JSON::Validator::JSONValidator* getValidator(
- Framework::JSON::Validator::ObjectValidationBuilder<
- Framework::JSON::Validator::JSONValidator>* builder) const override;
- Framework::Text getTypeToken() const override;
- };
- class PlaceableProofBlockFilter : public PlaceableProof
- {
- private:
- Direction direction;
- int distance;
- BlockFilter* filter;
- public:
- PlaceableProofBlockFilter(
- Direction direction, int distance, BlockFilter* filter);
- ~PlaceableProofBlockFilter();
- bool isPlacable(
- const Item* item, Framework::Vec3<float> pos, int dimensionId) override;
- Direction getDirection() const;
- int getDistance() const;
- BlockFilter* zFilter() const;
- };
- class PlaceableProofBlockFilterFactory
- : public SubTypeFactory<PlaceableProof, PlaceableProofBlockFilter>
- {
- public:
- PlaceableProofBlockFilterFactory();
- PlaceableProofBlockFilter* fromJson(
- Framework::JSON::JSONObject* zJson) const override;
- Framework::JSON::JSONObject* toJson(
- PlaceableProofBlockFilter* zObject) const override;
- Framework::JSON::Validator::JSONValidator* getValidator(
- Framework::JSON::Validator::ObjectValidationBuilder<
- Framework::JSON::Validator::JSONValidator>* builder) const override;
- Framework::Text getTypeToken() const override;
- };
- // TODO: add item Filter
|