summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-06-29 21:56:30 +0300
committerAndrei Karas <akaras@inbox.ru>2016-06-30 00:03:20 +0300
commitd0a72be7362cfad41187b6e9544ac44802a66ebd (patch)
tree76ca7130307a6f9b9b648ffd019fe0bba5cfda67 /src/resources
parente2c1b87e38e5c921912b334ca971e92b7989f8a8 (diff)
downloadmanaplus-d0a72be7362cfad41187b6e9544ac44802a66ebd.tar.gz
manaplus-d0a72be7362cfad41187b6e9544ac44802a66ebd.tar.bz2
manaplus-d0a72be7362cfad41187b6e9544ac44802a66ebd.tar.xz
manaplus-d0a72be7362cfad41187b6e9544ac44802a66ebd.zip
Remove basic attributes usage from generalhandler and move to statuswindow and statdb.
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/basicstat.h14
-rw-r--r--src/resources/db/statdb.cpp48
2 files changed, 47 insertions, 15 deletions
diff --git a/src/resources/basicstat.h b/src/resources/basicstat.h
index 598e9dc8b..a57581ffe 100644
--- a/src/resources/basicstat.h
+++ b/src/resources/basicstat.h
@@ -23,20 +23,28 @@
#ifndef RESOURCES_BASICSTAT_H
#define RESOURCES_BASICSTAT_H
+#include "enums/being/attributes.h"
+
#include <string>
#include "localconsts.h"
struct BasicStat final
{
- BasicStat(const std::string &tag0,
- const std::string &format0) :
+ BasicStat(const AttributesT attr0,
+ const std::string &tag0,
+ const std::string &name0,
+ const std::string &format0) :
tag(tag0),
- format(format0)
+ name(name0),
+ format(format0),
+ attr(attr0)
{}
std::string tag;
+ std::string name;
std::string format;
+ AttributesT attr;
};
#endif // RESOURCES_BASICSTAT_H
diff --git a/src/resources/db/statdb.cpp b/src/resources/db/statdb.cpp
index 0d25b07dd..36748c476 100644
--- a/src/resources/db/statdb.cpp
+++ b/src/resources/db/statdb.cpp
@@ -41,18 +41,42 @@ namespace
void StatDb::addBasicStats()
{
- // TRANSLATORS: player stat
- mBasicStats.push_back(BasicStat("str", _("Strength %s")));
- // TRANSLATORS: player stat
- mBasicStats.push_back(BasicStat("agi", _("Agility %s")));
- // TRANSLATORS: player stat
- mBasicStats.push_back(BasicStat("vit", _("Vitality %s")));
- // TRANSLATORS: player stat
- mBasicStats.push_back(BasicStat("int", _("Intelligence %s")));
- // TRANSLATORS: player stat
- mBasicStats.push_back(BasicStat("dex", _("Dexterity %s")));
- // TRANSLATORS: player stat
- mBasicStats.push_back(BasicStat("luck", _("Luck %s")));
+ mBasicStats.push_back(BasicStat(Attributes::STR,
+ "str",
+ // TRANSLATORS: player stat
+ _("Strength"),
+ // TRANSLATORS: player stat
+ _("Strength %s")));
+ mBasicStats.push_back(BasicStat(Attributes::AGI,
+ "agi",
+ // TRANSLATORS: player stat
+ _("Agility"),
+ // TRANSLATORS: player stat
+ _("Agility %s")));
+ mBasicStats.push_back(BasicStat(Attributes::VIT,
+ "vit",
+ // TRANSLATORS: player stat
+ _("Vitality"),
+ // TRANSLATORS: player stat
+ _("Vitality %s")));
+ mBasicStats.push_back(BasicStat(Attributes::INT,
+ "int",
+ // TRANSLATORS: player stat
+ _("Intelligence"),
+ // TRANSLATORS: player stat
+ _("Intelligence %s")));
+ mBasicStats.push_back(BasicStat(Attributes::DEX,
+ "dex",
+ // TRANSLATORS: player stat
+ _("Dexterity"),
+ // TRANSLATORS: player stat
+ _("Dexterity %s")));
+ mBasicStats.push_back(BasicStat(Attributes::LUK,
+ "luk",
+ // TRANSLATORS: player stat
+ _("Luck"),
+ // TRANSLATORS: player stat
+ _("Luck %s")));
}
const std::vector<BasicStat> &StatDb::getExtraStats()