From 60a2ed8ee8aa994c83d382af2ec477e171beb950 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Mon, 9 Jun 2008 00:50:59 +0000 Subject: [FIX] All modules now use their own namespace git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@201 6ecfd1a5-f3ed-3746-8530-beee90d26b22 --- pokemod/Map.cpp | 164 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 82 insertions(+), 82 deletions(-) (limited to 'pokemod/Map.cpp') diff --git a/pokemod/Map.cpp b/pokemod/Map.cpp index 5979a045..419d75e3 100644 --- a/pokemod/Map.cpp +++ b/pokemod/Map.cpp @@ -28,15 +28,15 @@ // Qt includes #include -const QStringList Map::TypeStr = QStringList() << "Outdoor" << "Dungeon" << "Building"; +const QStringList Pokemod::Map::TypeStr = QStringList() << "Outdoor" << "Dungeon" << "Building"; -Map::Map(const Map& map) : +Pokemod::Map::Map(const Map& map) : Object("Map", map.parent(), map.id()) { *this = map; } -Map::Map(const Pokemod* parent, const int id) : +Pokemod::Map::Map(const Pokemod* parent, const int id) : Object("Map", parent, id), m_name(""), m_flyWarp(INT_MAX), @@ -44,24 +44,24 @@ Map::Map(const Pokemod* parent, const int id) : { } -Map::Map(const Map& map, const Pokemod* parent, const int id) : +Pokemod::Map::Map(const Map& map, const Pokemod* parent, const int id) : Object("Map", parent, id) { *this = map; } -Map::Map(const QDomElement& xml, const Pokemod* parent, const int id) : +Pokemod::Map::Map(const QDomElement& xml, const Pokemod* parent, const int id) : Object("Map", parent, id) { load(xml, id); } -Map::~Map() +Pokemod::Map::~Map() { clear(); } -void Map::validate() +void Pokemod::Map::validate() { if (m_name.isEmpty()) emit(error("Name is empty")); @@ -122,7 +122,7 @@ void Map::validate() } } -void Map::load(const QDomElement& xml, int id) +void Pokemod::Map::load(const QDomElement& xml, int id) { LOAD_ID(); LOAD(QString, name); @@ -135,7 +135,7 @@ void Map::load(const QDomElement& xml, int id) LOAD_SUB(newWildList, MapWildList); } -QDomElement Map::save() const +QDomElement Pokemod::Map::save() const { SAVE_CREATE(); SAVE(QString, name); @@ -149,12 +149,12 @@ QDomElement Map::save() const return xml; } -void Map::setName(const QString& name) +void Pokemod::Map::setName(const QString& name) { CHECK(name); } -void Map::setFlyWarp(const int flyWarp) +void Pokemod::Map::setFlyWarp(const int flyWarp) { if ((flyWarp != INT_MAX) && (warpIndex(flyWarp) == INT_MAX)) { @@ -164,7 +164,7 @@ void Map::setFlyWarp(const int flyWarp) CHECK(flyWarp); } -void Map::setType(const int type) +void Pokemod::Map::setType(const int type) { if (End <= type) { @@ -174,22 +174,22 @@ void Map::setType(const int type) CHECK(type); } -QString Map::name() const +QString Pokemod::Map::name() const { return m_name; } -int Map::flyWarp() const +int Pokemod::Map::flyWarp() const { return m_flyWarp; } -int Map::type() const +int Pokemod::Map::type() const { return m_type; } -void Map::setTile(const int row, const int column, const int tile) +void Pokemod::Map::setTile(const int row, const int column, const int tile) { if (static_cast(pokemod())->tileIndex(tile) == INT_MAX) { @@ -199,89 +199,89 @@ void Map::setTile(const int row, const int column, const int tile) m_tile.set(row, column, tile); } -void Map::insertColumn(const int column) +void Pokemod::Map::insertColumn(const int column) { m_tile.insertColumn(column, 0); } -void Map::insertRow(const int row) +void Pokemod::Map::insertRow(const int row) { m_tile.insertRow(row, 0); } -void Map::addColumn() +void Pokemod::Map::addColumn() { m_tile.addColumn(0); } -void Map::addRow() +void Pokemod::Map::addRow() { m_tile.addRow(0); } -void Map::deleteColumn(const int column) +void Pokemod::Map::deleteColumn(const int column) { m_tile.deleteColumn(column); } -void Map::deleteRow(const int row) +void Pokemod::Map::deleteRow(const int row) { m_tile.deleteRow(row); } -const Matrix* Map::map() const +const Pokemod::Matrix* Pokemod::Map::map() const { return &m_tile; } -Matrix* Map::map() +Pokemod::Matrix* Pokemod::Map::map() { return &m_tile; } -int Map::tile(const int row, const int column) const +int Pokemod::Map::tile(const int row, const int column) const { return m_tile.at(row, column); } -int Map::width() const +int Pokemod::Map::width() const { return m_tile.width(); } -int Map::height() const +int Pokemod::Map::height() const { return m_tile.height(); } -Point Map::size() const +Pokemod::Point Pokemod::Map::size() const { return m_tile.size(); } -const MapEffect* Map::effect(const int index) const +const Pokemod::MapEffect* Pokemod::Map::effect(const int index) const { Q_ASSERT(index < effectCount()); return m_effects.at(index); } -MapEffect* Map::effect(const int index) +Pokemod::MapEffect* Pokemod::Map::effect(const int index) { Q_ASSERT(index < effectCount()); return m_effects[index]; } -const MapEffect* Map::effectById(const int index) const +const Pokemod::MapEffect* Pokemod::Map::effectById(const int index) const { return effect(effectIndex(index)); } -MapEffect* Map::effectById(const int index) +Pokemod::MapEffect* Pokemod::Map::effectById(const int index) { return effect(effectIndex(index)); } -int Map::effectIndex(const int id) const +int Pokemod::Map::effectIndex(const int id) const { for (int i = 0; i < effectCount(); ++i) { @@ -291,45 +291,45 @@ int Map::effectIndex(const int id) const return INT_MAX; } -int Map::effectCount() const +int Pokemod::Map::effectCount() const { return m_effects.size(); } -MapEffect* Map::newEffect() +Pokemod::MapEffect* Pokemod::Map::newEffect() { return newEffect(new MapEffect(this, newEffectId())); } -MapEffect* Map::newEffect(const QDomElement& xml) +Pokemod::MapEffect* Pokemod::Map::newEffect(const QDomElement& xml) { return newEffect(new MapEffect(xml, this, newEffectId())); } -MapEffect* Map::newEffect(const MapEffect& effect) +Pokemod::MapEffect* Pokemod::Map::newEffect(const MapEffect& effect) { return newEffect(new MapEffect(effect, this, newEffectId())); } -MapEffect* Map::newEffect(MapEffect* effect) +Pokemod::MapEffect* Pokemod::Map::newEffect(MapEffect* effect) { m_effects.append(effect); return effect; } -void Map::deleteEffect(const int index) +void Pokemod::Map::deleteEffect(const int index) { Q_ASSERT(index < effectCount()); delete m_effects[index]; m_effects.removeAt(index); } -void Map::deleteEffectById(const int id) +void Pokemod::Map::deleteEffectById(const int id) { deleteEffect(effectIndex(id)); } -int Map::newEffectId() const +int Pokemod::Map::newEffectId() const { int i = 0; while ((i < effectCount()) && (effectIndex(i) != INT_MAX)) @@ -337,29 +337,29 @@ int Map::newEffectId() const return i; } -const MapTrainer* Map::trainer(const int index) const +const Pokemod::MapTrainer* Pokemod::Map::trainer(const int index) const { Q_ASSERT(index < trainerCount()); return m_trainers.at(index); } -MapTrainer* Map::trainer(const int index) +Pokemod::MapTrainer* Pokemod::Map::trainer(const int index) { Q_ASSERT(index < trainerCount()); return m_trainers[index]; } -const MapTrainer* Map::trainerById(const int id) const +const Pokemod::MapTrainer* Pokemod::Map::trainerById(const int id) const { return trainer(trainerIndex(id)); } -MapTrainer* Map::trainerById(const int id) +Pokemod::MapTrainer* Pokemod::Map::trainerById(const int id) { return trainer(trainerIndex(id)); } -int Map::trainerIndex(const int id) const +int Pokemod::Map::trainerIndex(const int id) const { for (int i = 0; i < trainerCount(); ++i) { @@ -369,45 +369,45 @@ int Map::trainerIndex(const int id) const return INT_MAX; } -int Map::trainerCount() const +int Pokemod::Map::trainerCount() const { return m_trainers.size(); } -MapTrainer* Map::newTrainer() +Pokemod::MapTrainer* Pokemod::Map::newTrainer() { return newTrainer(new MapTrainer(this, newTrainerId())); } -MapTrainer* Map::newTrainer(const QDomElement& xml) +Pokemod::MapTrainer* Pokemod::Map::newTrainer(const QDomElement& xml) { return newTrainer(new MapTrainer(xml, this, newTrainerId())); } -MapTrainer* Map::newTrainer(const MapTrainer& trainer) +Pokemod::MapTrainer* Pokemod::Map::newTrainer(const MapTrainer& trainer) { return newTrainer(new MapTrainer(trainer, this, newTrainerId())); } -MapTrainer* Map::newTrainer(MapTrainer* trainer) +Pokemod::MapTrainer* Pokemod::Map::newTrainer(MapTrainer* trainer) { m_trainers.append(trainer); return trainer; } -void Map::deleteTrainer(const int index) +void Pokemod::Map::deleteTrainer(const int index) { Q_ASSERT(index < trainerCount()); delete m_trainers[index]; m_trainers.removeAt(index); } -void Map::deleteTrainerById(const int id) +void Pokemod::Map::deleteTrainerById(const int id) { deleteTrainer(trainerIndex(id)); } -int Map::newTrainerId() const +int Pokemod::Map::newTrainerId() const { int i = 0; while ((i < trainerCount()) && (trainerIndex(i) != INT_MAX)) @@ -415,29 +415,29 @@ int Map::newTrainerId() const return i; } -const MapWarp* Map::warp(const int index) const +const Pokemod::MapWarp* Pokemod::Map::warp(const int index) const { Q_ASSERT(index < warpCount()); return m_warps.at(index); } -MapWarp* Map::warp(const int index) +Pokemod::MapWarp* Pokemod::Map::warp(const int index) { Q_ASSERT(index < warpCount()); return m_warps[index]; } -const MapWarp* Map::warpById(const int id) const +const Pokemod::MapWarp* Pokemod::Map::warpById(const int id) const { return warp(warpIndex(id)); } -MapWarp* Map::warpById(const int id) +Pokemod::MapWarp* Pokemod::Map::warpById(const int id) { return warp(warpIndex(id)); } -int Map::warpIndex(const int id) const +int Pokemod::Map::warpIndex(const int id) const { for (int i = 0; i < warpCount(); ++i) { @@ -447,45 +447,45 @@ int Map::warpIndex(const int id) const return INT_MAX; } -int Map::warpCount() const +int Pokemod::Map::warpCount() const { return m_warps.size(); } -MapWarp* Map::newWarp() +Pokemod::MapWarp* Pokemod::Map::newWarp() { return newWarp(new MapWarp(this, newWarpId())); } -MapWarp* Map::newWarp(const QDomElement& xml) +Pokemod::MapWarp* Pokemod::Map::newWarp(const QDomElement& xml) { return newWarp(new MapWarp(xml, this, newWarpId())); } -MapWarp* Map::newWarp(const MapWarp& warp) +Pokemod::MapWarp* Pokemod::Map::newWarp(const MapWarp& warp) { return newWarp(new MapWarp(warp, this, newWarpId())); } -MapWarp* Map::newWarp(MapWarp* warp) +Pokemod::MapWarp* Pokemod::Map::newWarp(MapWarp* warp) { m_warps.append(warp); return warp; } -void Map::deleteWarp(const int index) +void Pokemod::Map::deleteWarp(const int index) { Q_ASSERT(index < warpCount()); delete m_warps[index]; m_warps.removeAt(index); } -void Map::deleteWarpById(const int id) +void Pokemod::Map::deleteWarpById(const int id) { deleteWarp(warpIndex(id)); } -int Map::newWarpId() const +int Pokemod::Map::newWarpId() const { int i = 0; while ((i < warpCount()) && (warpIndex(i) != INT_MAX)) @@ -493,29 +493,29 @@ int Map::newWarpId() const return i; } -const MapWildList* Map::wildList(const int index) const +const Pokemod::MapWildList* Pokemod::Map::wildList(const int index) const { Q_ASSERT(index < wildListCount()); return m_wildLists.at(index); } -MapWildList* Map::wildList(const int index) +Pokemod::MapWildList* Pokemod::Map::wildList(const int index) { Q_ASSERT(index < wildListCount()); return m_wildLists[index]; } -const MapWildList* Map::wildListById(const int id) const +const Pokemod::MapWildList* Pokemod::Map::wildListById(const int id) const { return wildList(wildListIndex(id)); } -MapWildList* Map::wildListById(const int id) +Pokemod::MapWildList* Pokemod::Map::wildListById(const int id) { return wildList(wildListIndex(id)); } -int Map::wildListIndex(const int id) const +int Pokemod::Map::wildListIndex(const int id) const { for (int i = 0; i < wildListCount(); ++i) { @@ -525,45 +525,45 @@ int Map::wildListIndex(const int id) const return INT_MAX; } -int Map::wildListCount() const +int Pokemod::Map::wildListCount() const { return m_wildLists.size(); } -MapWildList* Map::newWildList() +Pokemod::MapWildList* Pokemod::Map::newWildList() { return newWildList(new MapWildList(this, newWildListId())); } -MapWildList* Map::newWildList(const QDomElement& xml) +Pokemod::MapWildList* Pokemod::Map::newWildList(const QDomElement& xml) { return newWildList(new MapWildList(xml, this, newWildListId())); } -MapWildList* Map::newWildList(const MapWildList& wildList) +Pokemod::MapWildList* Pokemod::Map::newWildList(const MapWildList& wildList) { return newWildList(new MapWildList(wildList, this, newWildListId())); } -MapWildList* Map::newWildList(MapWildList* wildList) +Pokemod::MapWildList* Pokemod::Map::newWildList(MapWildList* wildList) { m_wildLists.append(wildList); return wildList; } -void Map::deleteWildList(const int index) +void Pokemod::Map::deleteWildList(const int index) { Q_ASSERT(index < wildListCount()); delete m_wildLists[index]; m_wildLists.removeAt(index); } -void Map::deleteWildListById(const int id) +void Pokemod::Map::deleteWildListById(const int id) { deleteWildList(wildListIndex(id)); } -int Map::newWildListId() const +int Pokemod::Map::newWildListId() const { int i = 0; while ((i < warpCount()) && (warpIndex(i) != INT_MAX)) @@ -571,7 +571,7 @@ int Map::newWildListId() const return i; } -Map& Map::operator=(const Map& rhs) +Pokemod::Map& Pokemod::Map::operator=(const Map& rhs) { if (this == &rhs) return *this; @@ -587,7 +587,7 @@ Map& Map::operator=(const Map& rhs) return *this; } -void Map::clear() +void Pokemod::Map::clear() { while (effectCount()) deleteEffect(0); -- cgit