123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- #pragma once
- #include "TypeRegistry.h"
- class Entity;
- class Item;
- class QuestStorage;
- class QuestReward : public virtual Framework::ReferenceCounter
- {
- protected:
- Framework::Text rewardId;
- public:
- QuestReward(Framework::Text rewardId);
- virtual void giveReward(Framework::XML::Element* zParent,
- QuestStorage* zStorage,
- Entity* zTargetEntity)
- = 0;
- virtual void addRewardUIML(
- Framework::XML::Element* zParent, QuestStorage* zStorage, Framework::Text onClickPrefix)
- = 0;
- virtual bool validateSettings(
- Framework::XML::Element* zParent, QuestStorage *zStorage);
- virtual void api(Framework::StreamReader* message,
- Framework::XML::Element* zParent, QuestStorage* zStorage);
- const Framework::Text& getRewardId() const;
- };
- class ItemStackInfo : public virtual Framework::ReferenceCounter
- {
- private:
- Item* item;
- int count;
- public:
- ItemStackInfo(Item* item, int count);
- ~ItemStackInfo();
- Item* zItem() const;
- int getCount() const;
- };
- class ItemStackInfoType : public TypeFactory<ItemStackInfo>
- {
- public:
- ItemStackInfoType();
- ItemStackInfo* fromJson(Framework::JSON::JSONValue* zJson) const override;
- Framework::JSON::JSONValue* toJson(ItemStackInfo* zObject) const override;
- Framework::JSON::Validator::JSONValidator* getValidator() const override;
- };
- class QuestRewardGiveItemsType;
- class QuestRewardGiveItems : public QuestReward
- {
- private:
- Framework::RCArray<ItemStackInfo> items;
- public:
- QuestRewardGiveItems(Framework::Text rewardId);
- void giveReward(Framework::XML::Element* zParent,
- QuestStorage* zStorage,
- Entity* zTargetEntity) override;
- void addRewardUIML(Framework::XML::Element* zParent,
- QuestStorage* zStorage,
- Framework::Text onClickPrefix) override;
- friend QuestRewardGiveItemsType;
- };
- class QuestRewardGiveItemsType
- : public SubTypeFactory<QuestReward, QuestRewardGiveItems>
- {
- public:
- QuestRewardGiveItemsType();
- QuestRewardGiveItems* fromJson(
- Framework::JSON::JSONObject* zJson) const override;
- Framework::JSON::JSONObject* toJson(
- QuestRewardGiveItems* zObject) const override;
- Framework::JSON::Validator::JSONValidator* getValidator(
- Framework::JSON::Validator::ObjectValidationBuilder<
- Framework::JSON::Validator::JSONValidator>* builder) const override;
- Framework::Text getTypeToken() const override;
- };
|