summaryrefslogtreecommitdiff
path: root/src/resources/db
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-07-14 01:31:22 +0300
committerAndrei Karas <akaras@inbox.ru>2017-07-14 01:31:22 +0300
commit311c175f3184103950c72bc5c775174597430b83 (patch)
treead022dc44a1c4177b3d53bf0d7eaa5a1736c8cf1 /src/resources/db
parent16bcb81b0509725e4546bcb3c390ca3c1bb7e7b1 (diff)
downloadmanaverse-311c175f3184103950c72bc5c775174597430b83.tar.gz
manaverse-311c175f3184103950c72bc5c775174597430b83.tar.bz2
manaverse-311c175f3184103950c72bc5c775174597430b83.tar.xz
manaverse-311c175f3184103950c72bc5c775174597430b83.zip
Replace std::vector into macro STD_VECTOR.
In most case it equal to std::vector except debug modes. Now it can be also mse::mstd::vector, but sadly this class not support all required features.
Diffstat (limited to 'src/resources/db')
-rw-r--r--src/resources/db/chardb.cpp4
-rw-r--r--src/resources/db/chardb.h2
-rw-r--r--src/resources/db/deaddb.cpp2
-rw-r--r--src/resources/db/itemdb.cpp4
-rw-r--r--src/resources/db/itemdb.h2
-rw-r--r--src/resources/db/itemoptiondb.cpp10
-rw-r--r--src/resources/db/itemoptiondb.h4
-rw-r--r--src/resources/db/networkdb.h2
-rw-r--r--src/resources/db/questdb.cpp18
-rw-r--r--src/resources/db/questdb.h4
-rw-r--r--src/resources/db/sounddb.cpp2
-rw-r--r--src/resources/db/statdb.cpp14
-rw-r--r--src/resources/db/statdb.h6
-rw-r--r--src/resources/db/unitsdb.cpp2
-rw-r--r--src/resources/db/weaponsdb.h2
15 files changed, 39 insertions, 39 deletions
diff --git a/src/resources/db/chardb.cpp b/src/resources/db/chardb.cpp
index fe87ea157..915c3444b 100644
--- a/src/resources/db/chardb.cpp
+++ b/src/resources/db/chardb.cpp
@@ -40,7 +40,7 @@ namespace
unsigned mMaxLook = 0;
unsigned mMinRace = 0;
unsigned mMaxRace = 30;
- std::vector<BeingSlot> mDefaultItems;
+ STD_VECTOR<BeingSlot> mDefaultItems;
} // namespace
void CharDB::load()
@@ -181,7 +181,7 @@ unsigned CharDB::getMaxRace()
return mMaxRace;
}
-const std::vector<BeingSlot> &CharDB::getDefaultItems()
+const STD_VECTOR<BeingSlot> &CharDB::getDefaultItems()
{
return mDefaultItems;
}
diff --git a/src/resources/db/chardb.h b/src/resources/db/chardb.h
index 083e7c12d..f940d3059 100644
--- a/src/resources/db/chardb.h
+++ b/src/resources/db/chardb.h
@@ -69,7 +69,7 @@ namespace CharDB
unsigned getMaxRace() A_WARN_UNUSED;
- const std::vector<BeingSlot> &getDefaultItems() A_WARN_UNUSED;
+ const STD_VECTOR<BeingSlot> &getDefaultItems() A_WARN_UNUSED;
} // namespace CharDB
#endif // RESOURCES_DB_CHARDB_H
diff --git a/src/resources/db/deaddb.cpp b/src/resources/db/deaddb.cpp
index bcca023eb..8c273e239 100644
--- a/src/resources/db/deaddb.cpp
+++ b/src/resources/db/deaddb.cpp
@@ -32,7 +32,7 @@
namespace
{
bool mLoaded = false;
- std::vector<std::string> mMessages;
+ STD_VECTOR<std::string> mMessages;
} // namespace
void DeadDB::load()
diff --git a/src/resources/db/itemdb.cpp b/src/resources/db/itemdb.cpp
index 57000cf95..e23623367 100644
--- a/src/resources/db/itemdb.cpp
+++ b/src/resources/db/itemdb.cpp
@@ -1050,10 +1050,10 @@ static void loadOrderSprite(ItemInfo *const itemInfo,
itemInfo->setDrawPriority(direction, priority);
}
-std::string ItemDB::getNamesStr(const std::vector<int> &parts)
+std::string ItemDB::getNamesStr(const STD_VECTOR<int> &parts)
{
std::string str;
- FOR_EACH (std::vector<int>::const_iterator, it, parts)
+ FOR_EACH (STD_VECTOR<int>::const_iterator, it, parts)
{
const int id = *it;
if (exists(id))
diff --git a/src/resources/db/itemdb.h b/src/resources/db/itemdb.h
index 34421d84b..96de60b6a 100644
--- a/src/resources/db/itemdb.h
+++ b/src/resources/db/itemdb.h
@@ -63,7 +63,7 @@ namespace ItemDB
const ItemDB::ItemInfos &getItemInfos();
- std::string getNamesStr(const std::vector<int> &parts);
+ std::string getNamesStr(const STD_VECTOR<int> &parts);
#ifdef UNITTESTS
ItemDB::NamedItemInfos &getNamedItemInfosTest();
diff --git a/src/resources/db/itemoptiondb.cpp b/src/resources/db/itemoptiondb.cpp
index bd78f95c5..2f7fc1ccd 100644
--- a/src/resources/db/itemoptiondb.cpp
+++ b/src/resources/db/itemoptiondb.cpp
@@ -33,7 +33,7 @@
namespace
{
ItemOptionDb::OptionInfos mOptions;
- const std::vector<ItemFieldType*> mEmptyOption;
+ const STD_VECTOR<ItemFieldType*> mEmptyOption;
bool mLoaded = false;
} // namespace
@@ -48,7 +48,7 @@ void ItemOptionDb::load()
mLoaded = true;
}
-static void addFieldByName(std::vector<ItemFieldType*> &options,
+static void addFieldByName(STD_VECTOR<ItemFieldType*> &options,
XmlNodeConstPtr node,
const ItemFieldDb::FieldInfos &fields,
const char *const name)
@@ -68,7 +68,7 @@ static void addFieldByName(std::vector<ItemFieldType*> &options,
}
}
-static void readOptionFields(std::vector<ItemFieldType*> &options,
+static void readOptionFields(STD_VECTOR<ItemFieldType*> &options,
XmlNodeConstPtr node,
const ItemFieldDb::FieldInfos &fields)
{
@@ -127,7 +127,7 @@ void ItemOptionDb::loadXmlFile(const std::string &fileName,
reportAlways("Empty id field in ItemOptionDb");
continue;
}
- std::vector<ItemFieldType*> &options = mOptions[id];
+ STD_VECTOR<ItemFieldType*> &options = mOptions[id];
readOptionFields(options, node, requiredFields);
readOptionFields(options, node, addFields);
}
@@ -140,7 +140,7 @@ void ItemOptionDb::unload()
mLoaded = false;
}
-const std::vector<ItemFieldType*> &ItemOptionDb::getFields(const int id)
+const STD_VECTOR<ItemFieldType*> &ItemOptionDb::getFields(const int id)
{
OptionInfos::const_iterator it = mOptions.find(id);
if (it == mOptions.end())
diff --git a/src/resources/db/itemoptiondb.h b/src/resources/db/itemoptiondb.h
index a4fb82638..8d9bc9968 100644
--- a/src/resources/db/itemoptiondb.h
+++ b/src/resources/db/itemoptiondb.h
@@ -41,9 +41,9 @@ namespace ItemOptionDb
void loadXmlFile(const std::string &fileName,
const SkipError skipError);
- const std::vector<ItemFieldType*> &getFields(const int id);
+ const STD_VECTOR<ItemFieldType*> &getFields(const int id);
- typedef std::map<int, std::vector<ItemFieldType*> > OptionInfos;
+ typedef std::map<int, STD_VECTOR<ItemFieldType*> > OptionInfos;
} // namespace ItemOptionDb
#endif // RESOURCES_DB_ITEMOPTIONDB_H
diff --git a/src/resources/db/networkdb.h b/src/resources/db/networkdb.h
index 697adbc44..0541f9c1f 100644
--- a/src/resources/db/networkdb.h
+++ b/src/resources/db/networkdb.h
@@ -30,7 +30,7 @@
typedef std::map<int32_t, int32_t> NetworkInPacketInfos;
typedef NetworkInPacketInfos::const_iterator NetworkInPacketInfosIter;
-typedef std::vector<int> NetworkRemovePacketInfos;
+typedef STD_VECTOR<int> NetworkRemovePacketInfos;
typedef NetworkRemovePacketInfos::const_iterator NetworkRemovePacketInfosIter;
namespace NetworkDb
diff --git a/src/resources/db/questdb.cpp b/src/resources/db/questdb.cpp
index 6ac2c7f34..44c59226c 100644
--- a/src/resources/db/questdb.cpp
+++ b/src/resources/db/questdb.cpp
@@ -39,8 +39,8 @@ namespace
// quest variables: var, (val1, val2, val3, time)
NpcQuestVarMap mVars;
// quests: var, quests
- std::map<int, std::vector<QuestItem*> > mQuests;
- std::vector<QuestEffect*> mAllEffects;
+ std::map<int, STD_VECTOR<QuestItem*> > mQuests;
+ STD_VECTOR<QuestEffect*> mAllEffects;
} // namespace
void QuestDb::load()
@@ -213,11 +213,11 @@ void QuestDb::loadXmlFile(const std::string &fileName,
void QuestDb::unload()
{
- for (std::map<int, std::vector<QuestItem*> >::iterator it
+ for (std::map<int, STD_VECTOR<QuestItem*> >::iterator it
= mQuests.begin(), it_end = mQuests.end(); it != it_end; ++ it)
{
- std::vector<QuestItem*> &quests = (*it).second;
- for (std::vector<QuestItem*>::iterator it2 = quests.begin(),
+ STD_VECTOR<QuestItem*> &quests = (*it).second;
+ for (STD_VECTOR<QuestItem*>::iterator it2 = quests.begin(),
it2_end = quests.end(); it2 != it2_end; ++ it2)
{
delete *it2;
@@ -233,26 +233,26 @@ NpcQuestVarMap *QuestDb::getVars()
return &mVars;
}
-std::map<int, std::vector<QuestItem*> > *QuestDb::getQuests()
+std::map<int, STD_VECTOR<QuestItem*> > *QuestDb::getQuests()
{
return &mQuests;
}
-std::vector<QuestEffect*> *QuestDb::getAllEffects()
+STD_VECTOR<QuestEffect*> *QuestDb::getAllEffects()
{
return &mAllEffects;
}
std::string QuestDb::getName(const int id)
{
- std::map<int, std::vector<QuestItem*> >::const_iterator it =
+ std::map<int, STD_VECTOR<QuestItem*> >::const_iterator it =
mQuests.find(id);
if (it == mQuests.end())
{
// TRANSLATORS: quests window quest name
return _("unknown");
}
- const std::vector<QuestItem*> &items = (*it).second;
+ const STD_VECTOR<QuestItem*> &items = (*it).second;
if (items.empty())
{
// TRANSLATORS: quests window quest name
diff --git a/src/resources/db/questdb.h b/src/resources/db/questdb.h
index 1bec2cc4e..865f917fe 100644
--- a/src/resources/db/questdb.h
+++ b/src/resources/db/questdb.h
@@ -45,9 +45,9 @@ namespace QuestDb
NpcQuestVarMap *getVars();
- std::map<int, std::vector<QuestItem*> > *getQuests();
+ std::map<int, STD_VECTOR<QuestItem*> > *getQuests();
- std::vector<QuestEffect*> *getAllEffects();
+ STD_VECTOR<QuestEffect*> *getAllEffects();
std::string getName(const int id);
} // namespace QuestDb
diff --git a/src/resources/db/sounddb.cpp b/src/resources/db/sounddb.cpp
index 0907f5cdc..90dc9fe00 100644
--- a/src/resources/db/sounddb.cpp
+++ b/src/resources/db/sounddb.cpp
@@ -32,7 +32,7 @@
namespace
{
std::string mDefault;
- std::vector<std::string> mSounds;
+ STD_VECTOR<std::string> mSounds;
} // namespace
void SoundDB::load()
diff --git a/src/resources/db/statdb.cpp b/src/resources/db/statdb.cpp
index 26734bdb3..08fef09d6 100644
--- a/src/resources/db/statdb.cpp
+++ b/src/resources/db/statdb.cpp
@@ -35,9 +35,9 @@
namespace
{
bool mLoaded = false;
- std::vector<BasicStat> mBasicStats;
- std::map<std::string, std::vector<BasicStat> > mStats;
- std::vector<std::string> mPages;
+ STD_VECTOR<BasicStat> mBasicStats;
+ std::map<std::string, STD_VECTOR<BasicStat> > mStats;
+ STD_VECTOR<std::string> mPages;
} // namespace
void StatDb::addDefaultStats()
@@ -68,17 +68,17 @@ void StatDb::addDefaultStats()
_("Luck")));
}
-const std::vector<BasicStat> &StatDb::getBasicStats()
+const STD_VECTOR<BasicStat> &StatDb::getBasicStats()
{
return mBasicStats;
}
-const std::vector<BasicStat> &StatDb::getStats(const std::string &page)
+const STD_VECTOR<BasicStat> &StatDb::getStats(const std::string &page)
{
return mStats[page];
}
-const std::vector<std::string> &StatDb::getPages()
+const STD_VECTOR<std::string> &StatDb::getPages()
{
return mPages;
}
@@ -135,7 +135,7 @@ static void loadStats(XmlNodeConstPtr rootNode,
const std::string &page)
{
const int maxAttr = static_cast<int>(Attributes::MAX_ATTRIBUTE);
- std::vector<BasicStat> &stats = mStats[page];
+ STD_VECTOR<BasicStat> &stats = mStats[page];
mPages.push_back(page);
for_each_xml_child_node(node, rootNode)
{
diff --git a/src/resources/db/statdb.h b/src/resources/db/statdb.h
index 898f0af63..73b24894b 100644
--- a/src/resources/db/statdb.h
+++ b/src/resources/db/statdb.h
@@ -40,11 +40,11 @@ namespace StatDb
void addDefaultStats();
- const std::vector<BasicStat> &getBasicStats();
+ const STD_VECTOR<BasicStat> &getBasicStats();
- const std::vector<BasicStat> &getStats(const std::string &page);
+ const STD_VECTOR<BasicStat> &getStats(const std::string &page);
- const std::vector<std::string> &getPages();
+ const STD_VECTOR<std::string> &getPages();
} // namespace StatDb
#endif // RESOURCES_DB_STATDB_H
diff --git a/src/resources/db/unitsdb.cpp b/src/resources/db/unitsdb.cpp
index 998dd7230..bf498411b 100644
--- a/src/resources/db/unitsdb.cpp
+++ b/src/resources/db/unitsdb.cpp
@@ -52,7 +52,7 @@ namespace
{
A_DEFAULT_COPY(UnitDescription)
- std::vector<struct UnitLevel> levels;
+ STD_VECTOR<struct UnitLevel> levels;
double conversion;
bool mix;
};
diff --git a/src/resources/db/weaponsdb.h b/src/resources/db/weaponsdb.h
index e30b4f544..a957347bc 100644
--- a/src/resources/db/weaponsdb.h
+++ b/src/resources/db/weaponsdb.h
@@ -25,7 +25,7 @@
#include "localconsts.h"
-typedef std::vector<int> WeaponsInfos;
+typedef STD_VECTOR<int> WeaponsInfos;
typedef WeaponsInfos::const_iterator WeaponsInfosIter;
namespace WeaponsDB