#pragma once #include #include "TypeRegistry.h" class EntityType; class Entity; class JBoolExpression; class JExpressionMemory; class Noise; class EntityGeneratorFactory; class EntityGenerator : public Framework::ReferenceCounter { private: Noise* noise; Framework::JSON::JSONObject* noiseConfig; double threshold; const EntityType* zType; JBoolExpression* condition; public: EntityGenerator(); ~EntityGenerator(); void initialize(JExpressionMemory* zMemory); bool isGenerated( int x, int y, int z, int dimensionId, JExpressionMemory* zMemory); Entity* generate(Framework::Vec3 pos, int dimesnionId); friend EntityGeneratorFactory; }; class EntityGeneratorFactory : public TypeFactory { public: EntityGeneratorFactory(); EntityGenerator* createValue( Framework::JSON::JSONObject* zJson) const override; void fromJson(EntityGenerator* zResult, Framework::JSON::JSONObject* zJson) const override; void toJson(EntityGenerator* zObject, Framework::JSON::JSONObject* zResult) const override; JSONObjectValidationBuilder* addToValidator( JSONObjectValidationBuilder* builder) const override; };