BlockInstanceGeneratorRule.h 1003 B

1234567891011121314151617181920212223242526272829303132
  1. #pragma once
  2. #include "GeneratorRule.h"
  3. class BlockInstanceGeneratorRule : public GeneratorRule
  4. {
  5. private:
  6. int blockType;
  7. public:
  8. BlockInstanceGeneratorRule();
  9. Framework::Either<Block*, int> createBlock(
  10. int x, int y, int z, int dimensionId) override;
  11. void setBlockTypeId(int blockType);
  12. int getBlockTypeId() const;
  13. };
  14. class BlockInstanceGeneratorRuleFactory
  15. : public GeneratorRuleFactory<BlockInstanceGeneratorRule>
  16. {
  17. public:
  18. BlockInstanceGeneratorRuleFactory();
  19. BlockInstanceGeneratorRule* createValue(
  20. Framework::JSON::JSONObject* zJson) const override;
  21. void fromJson(BlockInstanceGeneratorRule* zResult,
  22. Framework::JSON::JSONObject* zJson) const override;
  23. void toJson(BlockInstanceGeneratorRule* zObject,
  24. Framework::JSON::JSONObject* zResult) const override;
  25. JSONObjectValidationBuilder* addToValidator(
  26. JSONObjectValidationBuilder* builder) const override;
  27. Framework::Text getTypeToken() const override;
  28. };