#pragma once #include #include "GeneratorTemplate.h" #include "JsonExpression.h" #include "Noise.h" class StructureTemplateCollection : public virtual Framework::ReferenceCounter { private: Noise* activeNoise; Framework::JSON::JSONObject* activeNoiseConfig; Noise* structureNoise; Framework::JSON::JSONObject* structureNoiseConfig; double threshold; Framework::RCArray structures; Framework::Vec3 minAffected; Framework::Vec3 maxAffected; JBoolExpression* condition; public: StructureTemplateCollection(); ~StructureTemplateCollection(); void initialize(JExpressionMemory* zMemory); void generateStructures(int x, int y, int z, int dimensionId, JExpressionMemory* zMemory, Framework::Vec3 minPos, Framework::Vec3 maxPos, Framework::RCArray* zResult); void setThreshold(double threshold); double getThreshold() const; void setCondition(JBoolExpression* condition); JBoolExpression* zCondition() const; void setActiveNoiseConfig(Framework::JSON::JSONObject* activeNoiseConfig); Framework::JSON::JSONObject* zActiveNoiseConfig() const; void setStructureNoiseConfig( Framework::JSON::JSONObject* structureNoiseConfig); Framework::JSON::JSONObject* zStructureNoiseConfig() const; void addStructure(GeneratorTemplate* structure); const Framework::RCArray& getStructures() const; Framework::Vec3 getMinAffected() const; Framework::Vec3 getMaxAffected() const; }; class StructureTemplateCollectionFactory : public TypeFactory { public: StructureTemplateCollectionFactory(); StructureTemplateCollection* createValue( Framework::JSON::JSONObject* zJson) const override; void fromJson(StructureTemplateCollection* zResult, Framework::JSON::JSONObject* zJson) const override; void toJson(StructureTemplateCollection* zObject, Framework::JSON::JSONObject* zResult) const override; JSONObjectValidationBuilder* addToValidator( JSONObjectValidationBuilder* builder) const override; };