OpenDialogInteractionConfig.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #pragma once
  2. #include "InteractionConfig.h"
  3. class UIDialogElement;
  4. class OpenDialogInteractionConfig : public InteractionConfig
  5. {
  6. private:
  7. UIDialogElement* dialogElement;
  8. public:
  9. OpenDialogInteractionConfig();
  10. ~OpenDialogInteractionConfig();
  11. void setDialogElement(UIDialogElement* dialogElement);
  12. UIDialogElement* zDialogElement() const;
  13. protected:
  14. virtual bool onInteraction(Framework::Either<Block*, Entity*> target,
  15. Item* zItem,
  16. Entity* actor,
  17. bool& itemChanged) override;
  18. };
  19. class OpenDialogInteractionConfigFactory
  20. : public InteractionConfigFactory<OpenDialogInteractionConfig>
  21. {
  22. public:
  23. OpenDialogInteractionConfigFactory();
  24. virtual JSONObjectValidationBuilder* addToValidator(
  25. JSONObjectValidationBuilder* builder) const override;
  26. virtual OpenDialogInteractionConfig* fromJson(
  27. Framework::JSON::JSONObject* zJson) const override;
  28. virtual Framework::JSON::JSONObject* toJsonObject(
  29. OpenDialogInteractionConfig* zObject) const override;
  30. virtual const char* getTypeToken() const override;
  31. protected:
  32. virtual OpenDialogInteractionConfig* createValue(
  33. Framework::JSON::JSONObject* zJson) const override;
  34. };