diff options
Diffstat (limited to 'sigscript/MapWrapper.cpp')
| -rw-r--r-- | sigscript/MapWrapper.cpp | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/sigscript/MapWrapper.cpp b/sigscript/MapWrapper.cpp index 6ca1872b..f2f10b29 100644 --- a/sigscript/MapWrapper.cpp +++ b/sigscript/MapWrapper.cpp @@ -31,7 +31,10 @@ #include <sigmod/MapTrainer.h> #include <sigmod/MapWildList.h> -Sigscript::MapWrapper* Sigscript::MapWrapper::create(const Sigmod::Map* map, GameWrapper* parent) +using namespace Sigmod; +using namespace Sigscript; + +MapWrapper* MapWrapper::create(const Map* map, GameWrapper* parent) { Signature sig = Signature(parent, Subsignature(map->className(), map->id())); if (!m_instances.contains(sig)) @@ -39,69 +42,69 @@ Sigscript::MapWrapper* Sigscript::MapWrapper::create(const Sigmod::Map* map, Gam return qobject_cast<MapWrapper*>(m_instances[sig]); } -Sigscript::MapWrapper::MapWrapper(const Sigmod::Map* map, GameWrapper* parent) : +MapWrapper::MapWrapper(const Map* map, GameWrapper* parent) : ObjectWrapper(map, parent), m_map(map) { } -Sigscript::MapEffectWrapper* Sigscript::MapWrapper::effect(const int id) +MapEffectWrapper* MapWrapper::effect(const int id) { return MapEffectWrapper::create(m_map->effectById(id), this); } -Sigscript::MapTileWrapper* Sigscript::MapWrapper::tile(const int id) +MapTileWrapper* MapWrapper::tile(const int id) { return MapTileWrapper::create(m_map->tileById(id), this); } -Sigscript::MapTrainerWrapper* Sigscript::MapWrapper::trainer(const int id) +MapTrainerWrapper* MapWrapper::trainer(const int id) { return MapTrainerWrapper::create(m_map->trainerById(id), this); } -Sigscript::MapWarpWrapper* Sigscript::MapWrapper::warp(const int id) +MapWarpWrapper* MapWrapper::warp(const int id) { return MapWarpWrapper::create(m_map->warpById(id), this); } -Sigscript::MapWildListWrapper* Sigscript::MapWrapper::wildList(const int id) +MapWildListWrapper* MapWrapper::wildList(const int id) { return MapWildListWrapper::create(m_map->wildListById(id), this); } -Sigmod::Map::Type Sigscript::MapWrapper::type(const QString& name) const +Map::Type MapWrapper::type(const QString& name) const { if (name == "Outdoor") - return Sigmod::Map::Outdoor; + return Map::Outdoor; else if (name == "Dungeon") - return Sigmod::Map::Dungeon; + return Map::Dungeon; else if (name == "Building") - return Sigmod::Map::Building; - return QVariant(-1).value<Sigmod::Map::Type>(); + return Map::Building; + return QVariant(-1).value<Map::Type>(); } -QString Sigscript::MapWrapper::name() const +QString MapWrapper::name() const { return m_map->name(); } -Sigmod::Map::Type Sigscript::MapWrapper::type() const +Map::Type MapWrapper::type() const { return m_map->type(); } -int Sigscript::MapWrapper::width() const +int MapWrapper::width() const { return m_map->width(); } -int Sigscript::MapWrapper::height() const +int MapWrapper::height() const { return m_map->height(); } -Sigscript::MapEffectWrapper* Sigscript::MapWrapper::effect(const QString& name) +MapEffectWrapper* MapWrapper::effect(const QString& name) { for (int i = 0; i < m_map->effectCount(); ++i) { @@ -111,7 +114,7 @@ Sigscript::MapEffectWrapper* Sigscript::MapWrapper::effect(const QString& name) return NULL; } -QList<Sigscript::MapTileWrapper*> Sigscript::MapWrapper::tiles() +QList<MapTileWrapper*> MapWrapper::tiles() { QList<MapTileWrapper*> tiles; for (int i = 0; i < m_map->tileCount(); ++i) @@ -119,7 +122,7 @@ QList<Sigscript::MapTileWrapper*> Sigscript::MapWrapper::tiles() return tiles; } -Sigscript::MapTrainerWrapper* Sigscript::MapWrapper::trainer(const QString& name) +MapTrainerWrapper* MapWrapper::trainer(const QString& name) { for (int i = 0; i < m_map->trainerCount(); ++i) { @@ -129,7 +132,7 @@ Sigscript::MapTrainerWrapper* Sigscript::MapWrapper::trainer(const QString& name return NULL; } -Sigscript::MapWarpWrapper* Sigscript::MapWrapper::warp(const QString& name) +MapWarpWrapper* MapWrapper::warp(const QString& name) { for (int i = 0; i < m_map->warpCount(); ++i) { @@ -139,7 +142,7 @@ Sigscript::MapWarpWrapper* Sigscript::MapWrapper::warp(const QString& name) return NULL; } -Sigscript::MapWildListWrapper* Sigscript::MapWrapper::wildList(const QString& name) +MapWildListWrapper* MapWrapper::wildList(const QString& name) { for (int i = 0; i < m_map->wildListCount(); ++i) { |
