12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- #pragma once
- #include "TypeRegistry.h"
- class Entity;
- class Item;
- class QuestReward : public virtual Framework::ReferenceCounter
- {
- protected:
- Framework::Text rewardId;
- public:
- QuestReward(Framework::Text rewardId);
- virtual void giveReward(Entity* zTargetEntity) = 0;
- virtual Framework::Text getRewardUIML() = 0;
- 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;
- Framework::Text getRewardUIML() 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;
- };
|