UIFuelState.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #pragma once
  2. #include "UIElement.h"
  3. class UIReference;
  4. class UIFuelState : public UIElement
  5. {
  6. private:
  7. UIReference* reference;
  8. Framework::Text backgroundImagePath;
  9. Framework::Text foregroundImagePath;
  10. Framework::Text direction;
  11. public:
  12. UIFuelState();
  13. ~UIFuelState();
  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 UIFuelStateFactory : public UIElementFactory<UIFuelState>
  27. {
  28. public:
  29. UIFuelStateFactory();
  30. JSONObjectValidationBuilder* addToValidator(
  31. JSONObjectValidationBuilder* builder) const override;
  32. UIFuelState* fromJson(Framework::JSON::JSONObject* zJson) const override;
  33. Framework::JSON::JSONObject* toJsonObject(
  34. UIFuelState* zObject) const override;
  35. UIFuelState* createElement(
  36. Framework::JSON::JSONObject* zJson) const override;
  37. const char* getTypeToken() const override;
  38. };