summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-06-29 21:06:30 +0300
committerAndrei Karas <akaras@inbox.ru>2016-06-30 00:03:20 +0300
commite2c1b87e38e5c921912b334ca971e92b7989f8a8 (patch)
treeeb95d5d620c5318403bafd014738906c3d602adf
parent370a8245ae3fbbfe449000b6bdaab366d08d925e (diff)
downloadmanaverse-e2c1b87e38e5c921912b334ca971e92b7989f8a8.tar.gz
manaverse-e2c1b87e38e5c921912b334ca971e92b7989f8a8.tar.bz2
manaverse-e2c1b87e38e5c921912b334ca971e92b7989f8a8.tar.xz
manaverse-e2c1b87e38e5c921912b334ca971e92b7989f8a8.zip
Rename ItemDb::Stat into BasicStat.
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--src/Makefile.am2
-rw-r--r--src/resources/basicstat.h (renamed from src/resources/itemdbstat.h)30
-rw-r--r--src/resources/db/itemdb.cpp6
-rw-r--r--src/resources/db/statdb.cpp16
-rw-r--r--src/resources/db/statdb.h4
6 files changed, 27 insertions, 33 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 69de475f3..d6a4a62e3 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -660,7 +660,7 @@ SET(SRCS
resources/imagewriter.h
resources/db/itemdb.cpp
resources/db/itemdb.h
- resources/itemdbstat.h
+ resources/basicstat.h
resources/db/itemfielddb.cpp
resources/db/itemfielddb.h
resources/iteminfo.h
diff --git a/src/Makefile.am b/src/Makefile.am
index d95601ad1..f3beb3f4c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1228,7 +1228,7 @@ manaplus_SOURCES += main.cpp \
resources/db/horsedb.h \
resources/db/itemdb.cpp \
resources/db/itemdb.h \
- resources/itemdbstat.h \
+ resources/basicstat.h \
resources/db/itemfielddb.cpp \
resources/db/itemfielddb.h \
resources/db/mapdb.cpp \
diff --git a/src/resources/itemdbstat.h b/src/resources/basicstat.h
index 94e12f987..598e9dc8b 100644
--- a/src/resources/itemdbstat.h
+++ b/src/resources/basicstat.h
@@ -20,29 +20,23 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef RESOURCES_DB_ITEMDBSTAT_H
-#define RESOURCES_DB_ITEMDBSTAT_H
+#ifndef RESOURCES_BASICSTAT_H
+#define RESOURCES_BASICSTAT_H
#include <string>
#include "localconsts.h"
-/**
- * Item information database.
- */
-namespace ItemDB
+struct BasicStat final
{
- struct Stat final
- {
- Stat(const std::string &tag0,
- const std::string &format0) :
- tag(tag0),
- format(format0)
- {}
+ BasicStat(const std::string &tag0,
+ const std::string &format0) :
+ tag(tag0),
+ format(format0)
+ {}
- std::string tag;
- std::string format;
- };
-} // namespace ItemDB
+ std::string tag;
+ std::string format;
+};
-#endif // RESOURCES_DB_ITEMDBSTAT_H
+#endif // RESOURCES_BASICSTAT_H
diff --git a/src/resources/db/itemdb.cpp b/src/resources/db/itemdb.cpp
index b35290639..4218771d6 100644
--- a/src/resources/db/itemdb.cpp
+++ b/src/resources/db/itemdb.cpp
@@ -28,7 +28,7 @@
#include "enums/resources/spritedirection.h"
-#include "resources/itemdbstat.h"
+#include "resources/basicstat.h"
#include "resources/iteminfo.h"
#include "resources/itemtypemapdata.h"
@@ -513,8 +513,8 @@ void ItemDB::loadXmlFile(const std::string &fileName,
std::string effect;
readFields(effect, node, requiredFields);
readFields(effect, node, addFields);
- const std::vector<Stat> &extraStats = StatDb::getExtraStats();
- FOR_EACH (std::vector<Stat>::const_iterator, it, extraStats)
+ const std::vector<BasicStat> &extraStats = StatDb::getExtraStats();
+ FOR_EACH (std::vector<BasicStat>::const_iterator, it, extraStats)
{
std::string value = XML::getProperty(
node, it->tag.c_str(), "");
diff --git a/src/resources/db/statdb.cpp b/src/resources/db/statdb.cpp
index 41c4b6c44..0d25b07dd 100644
--- a/src/resources/db/statdb.cpp
+++ b/src/resources/db/statdb.cpp
@@ -36,26 +36,26 @@
namespace
{
bool mLoaded = false;
- static std::vector<ItemDB::Stat> mBasicStats;
+ static std::vector<BasicStat> mBasicStats;
} // namespace
void StatDb::addBasicStats()
{
// TRANSLATORS: player stat
- mBasicStats.push_back(ItemDB::Stat("str", _("Strength %s")));
+ mBasicStats.push_back(BasicStat("str", _("Strength %s")));
// TRANSLATORS: player stat
- mBasicStats.push_back(ItemDB::Stat("agi", _("Agility %s")));
+ mBasicStats.push_back(BasicStat("agi", _("Agility %s")));
// TRANSLATORS: player stat
- mBasicStats.push_back(ItemDB::Stat("vit", _("Vitality %s")));
+ mBasicStats.push_back(BasicStat("vit", _("Vitality %s")));
// TRANSLATORS: player stat
- mBasicStats.push_back(ItemDB::Stat("int", _("Intelligence %s")));
+ mBasicStats.push_back(BasicStat("int", _("Intelligence %s")));
// TRANSLATORS: player stat
- mBasicStats.push_back(ItemDB::Stat("dex", _("Dexterity %s")));
+ mBasicStats.push_back(BasicStat("dex", _("Dexterity %s")));
// TRANSLATORS: player stat
- mBasicStats.push_back(ItemDB::Stat("luck", _("Luck %s")));
+ mBasicStats.push_back(BasicStat("luck", _("Luck %s")));
}
-const std::vector<ItemDB::Stat> &StatDb::getExtraStats()
+const std::vector<BasicStat> &StatDb::getExtraStats()
{
return mBasicStats;
}
diff --git a/src/resources/db/statdb.h b/src/resources/db/statdb.h
index 475de6095..5a5d3920a 100644
--- a/src/resources/db/statdb.h
+++ b/src/resources/db/statdb.h
@@ -23,7 +23,7 @@
#include "enums/simpletypes/skiperror.h"
-#include "resources/itemdbstat.h"
+#include "resources/basicstat.h"
#include <string>
#include <vector>
@@ -41,7 +41,7 @@ namespace StatDb
void addBasicStats();
- const std::vector<ItemDB::Stat> &getExtraStats();
+ const std::vector<BasicStat> &getExtraStats();
} // namespace StatDb
#endif // RESOURCES_DB_STATDB_H