aboutsummaryrefslogtreecommitdiff
path: root/src/entry.h
diff options
context:
space:
mode:
authorYour Name <you@example.com>2021-04-29 14:17:08 -0400
committerYour Name <you@example.com>2021-04-29 14:17:08 -0400
commit5a813a75412ac9b8fadb90c9abd46dd95aee8e9b (patch)
tree75c5466d459c793430a6481cd276a624cd843794 /src/entry.h
parentcd57ad6e208728bafcbc8c7d7b85d88603706978 (diff)
downloaddmtool-5a813a75412ac9b8fadb90c9abd46dd95aee8e9b.tar.gz
dmtool-5a813a75412ac9b8fadb90c9abd46dd95aee8e9b.tar.bz2
dmtool-5a813a75412ac9b8fadb90c9abd46dd95aee8e9b.zip
Removed data files from repo
Diffstat (limited to 'src/entry.h')
-rw-r--r--src/entry.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/entry.h b/src/entry.h
index 20f38e0..1badd40 100644
--- a/src/entry.h
+++ b/src/entry.h
@@ -8,14 +8,23 @@ namespace creature {
}
namespace entry {
+ class Entry;
+
+ // Set up default text generation
+ std::string genText(const Entry& e, const creature::Creature& c);
+
class Entry : public Jsonable {
public:
+ static std::shared_ptr<Entry> create(const nlohmann::json& data);
virtual ~Entry() {}
std::string getName(void) const {return name;}
std::string getType(void) const {return type;}
- std::string getText(void) const {return text;}
- virtual std::string getText(const creature::Creature& c) const;
+ virtual std::string getText(void) const {return text;}
+ virtual std::string getText(const creature::Creature& c) const {
+ //return genText(*this, c);
+ return genText(*this, c) + ": " + getText();
+ }
virtual nlohmann::json toJson(void) const {
return nlohmann::json({
@@ -33,7 +42,4 @@ namespace entry {
const std::string type;
const std::string text;
};
-
- // Set up default text generation
- std::string genText(const Entry& e, const creature::Creature& c);
}