diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-02-26 15:54:29 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-02-26 15:54:29 +0300 |
commit | b462762ae88e52ba18a0610c62a9dda6ac89d32d (patch) | |
tree | dc5d865703fd06b7c9bdc218f74301eec4cf77e0 /src/playerinfo.cpp | |
parent | 5190fe2cdac7c259d96619e4686f8543bdc96af4 (diff) | |
download | plus-b462762ae88e52ba18a0610c62a9dda6ac89d32d.tar.gz plus-b462762ae88e52ba18a0610c62a9dda6ac89d32d.tar.bz2 plus-b462762ae88e52ba18a0610c62a9dda6ac89d32d.tar.xz plus-b462762ae88e52ba18a0610c62a9dda6ac89d32d.zip |
Split skills and stats.
Diffstat (limited to 'src/playerinfo.cpp')
-rw-r--r-- | src/playerinfo.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/playerinfo.cpp b/src/playerinfo.cpp index b54f6c671..af4ed6837 100644 --- a/src/playerinfo.cpp +++ b/src/playerinfo.cpp @@ -106,6 +106,20 @@ void setAttribute(const int id, const int value, const bool notify) triggerAttr(id, old); } +int getSkillLevel(const int id) +{ + const IntMap::const_iterator it = mData.mSkills.find(id); + if (it != mData.mSkills.end()) + return it->second; + else + return 0; +} + +void setSkillLevel(const int id, const int value) +{ + mData.mSkills[id] = value; +} + // --- Stats ------------------------------------------------------------------ int getStatBase(const int id) @@ -367,6 +381,11 @@ void deinit() mListener = nullptr; } +void clear() +{ + mData.mSkills.clear(); +} + bool isTalking() { return NpcDialog::isActive() || NpcPostDialog::isActive() |