GeneratorTemplate.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #pragma once
  2. #include <ReferenceCounter.h>
  3. #include <Vec3.h>
  4. #include "GeneratedStructure.h"
  5. #include "Noise.h"
  6. class GeneratorTemplate : public Framework::ReferenceCounter
  7. {
  8. private:
  9. float propability;
  10. Framework::Vec3<int> minPosOffset;
  11. Framework::Vec3<int> maxSize;
  12. public:
  13. GeneratorTemplate(float propability,
  14. Framework::Vec3<int> minPosOffset,
  15. Framework::Vec3<int> maxSize);
  16. virtual bool canEffect(Framework::Vec3<int> location,
  17. Framework::Vec3<int> affectedLocation) const;
  18. virtual GeneratedStructure* generateAt(
  19. Framework::Vec3<int> location, Noise* zNoise, int dimensionId)
  20. = 0;
  21. float getPropability() const;
  22. Framework::Vec3<int> getMinAffectedOffset() const;
  23. Framework::Vec3<int> getMaxAffectedOffset() const;
  24. };
  25. class GeneratorTemplateFactory : public Framework::ReferenceCounter
  26. {
  27. public:
  28. GeneratorTemplateFactory();
  29. virtual GeneratorTemplate* createTemplate(
  30. Framework::JSON::JSONValue* zConfig)
  31. = 0;
  32. virtual Framework::JSON::Validator::JSONValidator* getValidator() = 0;
  33. };