12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- #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(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(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;
- };
|