blob: f8b2c8700cf88d6c1391b9a34fc3f4ab0ffe7dba (
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
27
|
#pragma once
#include "json.hpp"
#include "jsonable.h"
#include <memory>
namespace item{
class Item : public Jsonable {
public:
static std::shared_ptr<Item> create(const nlohmann::json& data);
virtual ~Item();
virtual std::string getName(void) const;
virtual int getCost(void) const;
virtual double getWeight(void) const;
virtual nlohmann::json toJson(void) const;
protected:
Item(const nlohmann::json& data);
private:
const std::string name;
const int cost;
const double weight;
};
}
|