/* * Copyright 2007-2009 Ben Boeckel * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #ifndef SIGMOD_MAP #define SIGMOD_MAP // Sigcore includes #include // Sigmod includes #include "Object.h" #include "Subclass.h" // Qt includes #include namespace Sigmod { // Forward declarations class Game; class MapEffect; class MapTile; class MapTrainer; class MapWarp; class MapWildList; class SIGMOD_EXPORT Map : public Object { Q_OBJECT Q_ENUMS(Type) public: typedef Subclass Effects; typedef Subclass Tiles; typedef Subclass Trainers; typedef Subclass Warps; typedef Subclass WildLists; Map(const Map& map); Map(const Game* parent, const int id); Map(const Map& map, const Game* parent, const int id); Map(const QDomElement& xml, const Game* parent, const int id = -1); void validate(); void load(const QDomElement& xml); QDomElement save() const; void setName(const QString& name); void setWidth(const int width); void setHeight(const int height); void setIsWorld(const bool isWorld); QString name() const; int width() const; int height() const; bool isWorld() const; const Effects& effects() const; Effects& effects(); const Tiles& tiles() const; Tiles& tiles(); const Trainers& trainers() const; Trainers& trainers(); const Warps& warps() const; Warps& warps(); const WildLists& wildLists() const; WildLists& wildLists(); bool nameCheck(const QString& name) const; bool widthCheck(const int width) const; bool heightCheck(const int height) const; bool isWorldCheck(const bool isWorld) const; Map& operator=(const Map& rhs); private: void clear(); QString m_name; int m_width; int m_height; bool m_isWorld; Effects m_effects; Tiles m_tiles; Trainers m_trainers; Warps m_warps; WildLists m_wildLists; }; } #endif