123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- #pragma once
- #include <JSON.h>
- #include <ReferenceCounter.h>
- #include "Reader.h"
- class ItemType;
- class ItemSkill;
- class Block;
- class Entity;
- class Dimension;
- class Item;
- class ItemSkillLevelUpRule : public virtual Framework::ReferenceCounter
- {
- public:
- virtual void applyOn(ItemSkill* zSkill) = 0;
- };
- class ItemSkill : public virtual Framework::ReferenceCounter
- {
- private:
- float xp;
- float maxXP;
- float level;
- int itemTypeId;
- public:
- ItemSkill(float xp, float maxXp, float level);
- virtual void load(Framework::StreamReader* zReader);
- virtual void save(Framework::StreamWriter* zWriter);
- virtual bool use(Entity* zActor, Item* zUsedItem, Block* zTarget) = 0;
- virtual bool use(Entity* zActor, Item* zUsedItem, Entity* zTarget) = 0;
- virtual bool interact(Entity* zActor, Item* zUsedItem, Block* zTarget);
- virtual bool interact(Entity* zActor, Item* zUsedItem, Entity* zTarget);
- void setXp(float xp);
- float getXp() const;
- void setMaxXp(float maxXp);
- float getMaxXp() const;
- void setLevel(float level);
- float getLevel() const;
- void setItemTypeId(int itemTypeId);
- int getItemTypeId() const;
- };
|