diff options
author | Nao Pross <naopross@thearcway.org> | 2018-02-25 21:11:43 +0100 |
---|---|---|
committer | Nao Pross <naopross@thearcway.org> | 2018-02-25 21:11:43 +0100 |
commit | 20b958c69451dd8251a8899cf7264d5c92ed7c60 (patch) | |
tree | 440ec68a189efdf42a21a9d621b6de2c04305fb5 /src/main/cpp/Actor.cpp | |
parent | Update CMakeLists and Makefile (diff) | |
download | Subconscious-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.cpp | 27 |
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; +} |