123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- #pragma once
- #include <Vec3.h>
- #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<float> pos, int dimesnionId);
- friend EntityGeneratorFactory;
- };
- class EntityGeneratorFactory : public ObjectTypeFactory<EntityGenerator>
- {
- public:
- EntityGeneratorFactory();
- EntityGenerator* fromJson(
- Framework::JSON::JSONObject* zJson) const override;
- Framework::JSON::JSONObject* toJsonObject(
- EntityGenerator* zObject) const override;
- JSONObjectValidationBuilder* addToValidator(
- JSONObjectValidationBuilder* builder) const override;
- };
|