summaryrefslogtreecommitdiffstats
path: root/pokemod/MapWildList.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pokemod/MapWildList.cpp')
-rw-r--r--pokemod/MapWildList.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/pokemod/MapWildList.cpp b/pokemod/MapWildList.cpp
index d08c84ce..1a05b1b4 100644
--- a/pokemod/MapWildList.cpp
+++ b/pokemod/MapWildList.cpp
@@ -19,6 +19,7 @@
#include "MapWildList.h"
// Pokemod includes
+#include "Macros.h"
#include "Map.h"
#include "MapWildListEncounter.h"
@@ -56,18 +57,16 @@ Pokemod::MapWildList::~MapWildList()
void Pokemod::MapWildList::validate()
{
+ TEST_BEGIN();
if (m_name.isEmpty())
emit(error("Name is empty"));
if (!encounterCount())
emit(error("There are no encounters"));
QSet<int> idChecker;
- foreach (MapWildListEncounter* encounter, m_encounters)
- {
- encounter->validate();
- if (idChecker.contains(encounter->id()))
- emit(error(subclass("encounter", encounter->id())));
- idChecker.insert(encounter->id());
- }
+ TEST_SUB_BEGIN(MapWildListEncounter, encounters);
+ TEST_SUB("encounter", id);
+ TEST_SUB_END();
+ TEST_END();
}
void Pokemod::MapWildList::load(const QDomElement& xml, int id)