diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2007-04-22 13:39:22 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2007-04-22 13:39:22 +0000 |
commit | 9398626764574fa536dca3806490f88970d2f056 (patch) | |
tree | b8a5f938d6d6447846773a6270802c3595077222 /src/resources/monsterdb.cpp | |
parent | ccf4dd308bcb8a592ece2d86102bbaa7080f0f7e (diff) | |
download | mana-9398626764574fa536dca3806490f88970d2f056.tar.gz mana-9398626764574fa536dca3806490f88970d2f056.tar.bz2 mana-9398626764574fa536dca3806490f88970d2f056.tar.xz mana-9398626764574fa536dca3806490f88970d2f056.zip |
Added a macro for XML child node iterations to make the code more terse and easier to read.
Diffstat (limited to 'src/resources/monsterdb.cpp')
-rw-r--r-- | src/resources/monsterdb.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/resources/monsterdb.cpp b/src/resources/monsterdb.cpp index e773911d..ac3ac3bc 100644 --- a/src/resources/monsterdb.cpp +++ b/src/resources/monsterdb.cpp @@ -72,11 +72,8 @@ MonsterDB::load() }
//iterate <monster>s
- for ( xmlNodePtr monsterNode = rootNode->xmlChildrenNode;
- monsterNode != NULL;
- monsterNode = monsterNode->next)
+ for_each_xml_child_node(monsterNode, rootNode)
{
-
if (!xmlStrEqual(monsterNode->name, BAD_CAST "monster"))
{
continue;
@@ -87,9 +84,7 @@ MonsterDB::load() currentInfo->setName (XML::getProperty(monsterNode, "name", "unnamed"));
//iterate <sprite>s and <sound>s
- for ( xmlNodePtr spriteNode = monsterNode->xmlChildrenNode;
- spriteNode != NULL;
- spriteNode = spriteNode->next)
+ for_each_xml_child_node(spriteNode, monsterNode)
{
if (xmlStrEqual(spriteNode->name, BAD_CAST "sprite"))
{
|