summaryrefslogtreecommitdiff
path: root/src/resources/db/npcdb.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-05-29 16:19:21 +0300
committerAndrei Karas <akaras@inbox.ru>2015-05-29 16:19:21 +0300
commit7bdb50605562e47f1d6ae134881c09bd42293be5 (patch)
tree935228722e4eb48f5856abec53be1ec985a0b9d6 /src/resources/db/npcdb.cpp
parent0f9ec2061c4ad6157c3186f1cab9c4d8558980b5 (diff)
downloadManaVerse-7bdb50605562e47f1d6ae134881c09bd42293be5.tar.gz
ManaVerse-7bdb50605562e47f1d6ae134881c09bd42293be5.tar.bz2
ManaVerse-7bdb50605562e47f1d6ae134881c09bd42293be5.tar.xz
ManaVerse-7bdb50605562e47f1d6ae134881c09bd42293be5.zip
Add strong typed int type BeingTypeId.
Diffstat (limited to 'src/resources/db/npcdb.cpp')
-rw-r--r--src/resources/db/npcdb.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/resources/db/npcdb.cpp b/src/resources/db/npcdb.cpp
index 8be92f186..8b47d33b4 100644
--- a/src/resources/db/npcdb.cpp
+++ b/src/resources/db/npcdb.cpp
@@ -81,10 +81,10 @@ void NPCDB::loadXmlFile(const std::string &fileName)
if (!xmlNameEqual(npcNode, "npc"))
continue;
- const BeingId id = fromInt(XML::getProperty(
- npcNode, "id", 0), BeingId);
+ const BeingTypeId id = fromInt(XML::getProperty(
+ npcNode, "id", 0), BeingTypeId);
BeingInfo *currentInfo = nullptr;
- if (id == BeingId_zero)
+ if (id == BeingTypeId_zero)
{
logger->log("NPC Database: NPC with missing ID in %s!",
paths.getStringValue("npcsFile").c_str());
@@ -107,7 +107,7 @@ void NPCDB::loadXmlFile(const std::string &fileName)
"deadSortOffsetY", 31));
currentInfo->setAvatarId(fromInt(XML::getProperty(
- npcNode, "avatar", 0), BeingId));
+ npcNode, "avatar", 0), BeingTypeId));
SpriteDisplay display;
for_each_xml_child_node(spriteNode, npcNode)
@@ -160,7 +160,7 @@ void NPCDB::unload()
mLoaded = false;
}
-BeingInfo *NPCDB::get(const BeingId id)
+BeingInfo *NPCDB::get(const BeingTypeId id)
{
const BeingInfoIterator i = mNPCInfos.find(id);
@@ -176,10 +176,10 @@ BeingInfo *NPCDB::get(const BeingId id)
}
}
-BeingId NPCDB::getAvatarFor(const BeingId id)
+BeingTypeId NPCDB::getAvatarFor(const BeingTypeId id)
{
const BeingInfo *const info = get(id);
if (!info)
- return BeingId_zero;
+ return BeingTypeId_zero;
return info->getAvatarId();
}