aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/cpp/Actor.cpp
diff options
context:
space:
mode:
authorNao Pross <naopross@thearcway.org>2018-02-25 21:11:43 +0100
committerNao Pross <naopross@thearcway.org>2018-02-25 21:11:43 +0100
commit20b958c69451dd8251a8899cf7264d5c92ed7c60 (patch)
tree440ec68a189efdf42a21a9d621b6de2c04305fb5 /src/main/cpp/Actor.cpp
parentUpdate CMakeLists and Makefile (diff)
downloadSubconscious-old-20b958c69451dd8251a8899cf7264d5c92ed7c60.tar.gz
Subconscious-old-20b958c69451dd8251a8899cf7264d5c92ed7c60.zip
Better management of stats and skill of actors and items
Diffstat (limited to 'src/main/cpp/Actor.cpp')
-rw-r--r--src/main/cpp/Actor.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/main/cpp/Actor.cpp b/src/main/cpp/Actor.cpp
index a6dc597..08911c5 100644
--- a/src/main/cpp/Actor.cpp
+++ b/src/main/cpp/Actor.cpp
@@ -25,3 +25,30 @@ void Actor::heal(int amt)
_hp = maxHp;
}
}
+
+void Actor::store(Item &item)
+{
+ // TODO check if item is already in inventory
+ _inventory.push_front(&item);
+}
+
+Item* Actor::drop()
+{
+ // TODO
+ Item *item = _inventory.front();
+ _inventory.pop_front();
+
+ return item;
+}
+
+unsigned Actor::stat(Actor::Stat stat) const
+{
+ return _stats.at(stat);
+}
+
+unsigned Actor::skill(Actor::Skill skill) const
+{
+ // TODO
+ // return _skills.at(skill);
+ return 0;
+}