summaryrefslogtreecommitdiff
path: root/src/playerinfo.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-02-26 15:54:29 +0300
committerAndrei Karas <akaras@inbox.ru>2013-02-26 15:54:29 +0300
commitb462762ae88e52ba18a0610c62a9dda6ac89d32d (patch)
treedc5d865703fd06b7c9bdc218f74301eec4cf77e0 /src/playerinfo.cpp
parent5190fe2cdac7c259d96619e4686f8543bdc96af4 (diff)
downloadplus-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.cpp19
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()