1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- #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 TypeFactory<EntityGenerator>
- {
- 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;
- };
|