| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- #pragma once
- #include "JsonExpression.h"
- #include "TypeRegistry.h"
- class PlantLocation
- {
- public:
- static const int CAVE = 1;
- static const int UNDERWATER = 2;
- static const int SURFACE = 4;
- };
- class PlantConfig : public virtual Framework::ReferenceCounter
- {
- private:
- JBoolExpression* condition;
- Noise* noise;
- Framework::JSON::JSONObject* noiseConfig;
- double threshold;
- int locations;
- Framework::Text plantBlockTypeName;
- int plantblockTypeId;
- int plantHeight;
- public:
- PlantConfig();
- ~PlantConfig();
- void initialize(JExpressionMemory* zMemory);
- double doesGeneratePlant(int x,
- int y,
- int z,
- int dimensionId,
- Chunk* zChunk,
- bool underground,
- bool underwater,
- int seaFluidBlockTypeId);
- void generatePlantAt(int x, int y, int z, int dimensionId, Chunk* zChunk);
- void setCondition(JBoolExpression* condition);
- JBoolExpression* zCondition() const;
- void setNoiseConfig(Framework::JSON::JSONObject* noiseConfig);
- Framework::JSON::JSONObject* zNoiseConfig() const;
- void setThreshold(double threshold);
- double getThreshold() const;
- void setLocations(int locations);
- int getLocations() const;
- void setPlantBlockTypeName(Framework::Text name);
- Framework::Text getPlantBlockTypeName() const;
- void setPlantHeight(int height);
- int getPlantHeight() const;
- };
- class PlantConfigFactory : public ObjectTypeFactory<PlantConfig>
- {
- public:
- PlantConfigFactory();
- PlantConfig* fromJson(Framework::JSON::JSONObject* zJson) const override;
- Framework::JSON::JSONObject* toJsonObject(
- PlantConfig* zObject) const override;
- JSONObjectValidationBuilder* addToValidator(
- JSONObjectValidationBuilder* builder) const override;
- };
|