QuestRequirement.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #pragma once
  2. #include "QuestEvent.h"
  3. #include "TypeRegistry.h"
  4. class QuestRequirementStorage;
  5. class QuestRequirement : public virtual Framework::ReferenceCounter
  6. {
  7. protected:
  8. Framework::Text id;
  9. Framework::Text description;
  10. public:
  11. QuestRequirement(Framework::Text id, Framework::Text description);
  12. virtual void processEvent(
  13. QuestEvent* zEvent, QuestRequirementStorage* zStorage)
  14. = 0;
  15. virtual Framework::Text getRequirementUIML(
  16. QuestRequirementStorage* zStorage)
  17. = 0;
  18. const Framework::Text& getRequirementId() const;
  19. const Framework::Text& getDescription() const;
  20. };
  21. class QuestRequirementOpenDialogType;
  22. class QuestRequirementOpenDialog : public QuestRequirement
  23. {
  24. private:
  25. Framework::Text dialogId;
  26. public:
  27. QuestRequirementOpenDialog(Framework::Text id,
  28. Framework::Text description,
  29. Framework::Text dialogId);
  30. void processEvent(
  31. QuestEvent* zEvent, QuestRequirementStorage* zStorage) override;
  32. Framework::Text getRequirementUIML(
  33. QuestRequirementStorage* zStorage) override;
  34. friend QuestRequirementOpenDialogType;
  35. };
  36. class QuestRequirementOpenDialogType
  37. : public SubTypeFactory<QuestRequirement, QuestRequirementOpenDialog>
  38. {
  39. public:
  40. QuestRequirementOpenDialogType();
  41. QuestRequirementOpenDialog* fromJson(
  42. Framework::JSON::JSONObject* zJson) const override;
  43. Framework::JSON::JSONObject* toJson(
  44. QuestRequirementOpenDialog* zObject) const override;
  45. Framework::JSON::Validator::JSONValidator* getValidator(
  46. Framework::JSON::Validator::ObjectValidationBuilder<
  47. Framework::JSON::Validator::JSONValidator>* builder) const override;
  48. Framework::Text getTypeToken() const override;
  49. };
  50. class QuestRequirementBlockBreak : public QuestRequirement
  51. {};
  52. class QuestRequirementBlockPlace : public QuestRequirement
  53. {};
  54. class QuestRequirementBlockInteract : public QuestRequirement
  55. {};
  56. class QuestRequirementCraft : public QuestRequirement
  57. {};
  58. class QuestRequirementItemInInventory : public QuestRequirement
  59. {};