UICraftingProgress.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #pragma once
  2. #include "UIElement.h"
  3. class UIReference;
  4. class UICraftingProgress : public UIElement
  5. {
  6. private:
  7. UIReference* reference;
  8. Framework::Text backgroundImagePath;
  9. Framework::Text foregroundImagePath;
  10. Framework::Text direction;
  11. public:
  12. UICraftingProgress();
  13. ~UICraftingProgress();
  14. void setReference(UIReference* reference);
  15. UIReference* zReference() const;
  16. void setBackgroundImagePath(const Framework::Text& backgroundImagePath);
  17. const Framework::Text& getBackgroundImagePath() const;
  18. void setForegroundImagePath(const Framework::Text& foregroundImagePath);
  19. const Framework::Text& getForegroundImagePath() const;
  20. void setDirection(const Framework::Text& direction);
  21. const Framework::Text& getDirection() const;
  22. virtual Framework::XML::Element* toUIML(
  23. Framework::Either<Block*, Entity*> zTarget,
  24. Entity* zActor) const override;
  25. };
  26. class UICraftingProgressFactory : public UIElementFactory<UICraftingProgress>
  27. {
  28. public:
  29. UICraftingProgressFactory();
  30. JSONObjectValidationBuilder* addToValidator(
  31. JSONObjectValidationBuilder* builder) const override;
  32. UICraftingProgress* fromJson(
  33. Framework::JSON::JSONObject* zJson) const override;
  34. Framework::JSON::JSONObject* toJsonObject(
  35. UICraftingProgress* zObject) const override;
  36. UICraftingProgress* createElement(
  37. Framework::JSON::JSONObject* zJson) const override;
  38. const char* getTypeToken() const override;
  39. };