aboutsummaryrefslogtreecommitdiff
path: root/src/item.h
blob: 33e67182cb2406a4cabfd744e5f980258b7a80c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#pragma once
#include <nlohmann/json.hpp>
#include "entry.h"
#include <memory>

namespace entry {
    struct itemImpl;

    class Item : public Entry {
        public:
            Item();
            static std::shared_ptr<Item> create(const nlohmann::json& data);
            virtual ~Item() {}
            virtual int getCost(void) const;
            virtual void setCost(int cost);
            virtual double getWeight(void) const;
            virtual void setWeight(double weight);
            virtual std::string getCostWeightText() const;
            virtual std::string getText() const override;
            virtual std::string getText(const creature::Creature& c) const override;

            NLOHMANN_FRIEND_DECLARES(Item);
        private:
            std::shared_ptr<itemImpl> data;
    };
}