From 20b958c69451dd8251a8899cf7264d5c92ed7c60 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Sun, 25 Feb 2018 21:11:43 +0100 Subject: Better management of stats and skill of actors and items --- src/main/cpp/Actor.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/main/cpp/Actor.cpp') 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; +} -- cgit v1.2.1