///////////////////////////////////////////////////////////////////////////// // Name: pokemod/Map.h // Purpose: Define a map for the game // Author: Ben Boeckel // Modified by: Ben Boeckel // Created: Mon May 28 2007 21:41:54 // Copyright: ©2007 Nerdy Productions // Licence: // 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 __POKEMOD_MAP__ #define __POKEMOD_MAP__ #include #include #include #include #include "../general/Matrix.h" #include "Object.h" #include "MapEffect.h" #include "MapTrainer.h" #include "MapWarp.h" #include "MapWildList.h" namespace PokeGen { namespace PokeMod { class Map : public Object { public: enum { Outdoor = 0, Dungeon = 1, Building = 2, End = 3 }; static const char* TypeStr[End]; Map(const Pokemod* par, const unsigned _id); Map(const Pokemod* par, Ini& ini, const unsigned _id = UINT_MAX); void ImportIni(Ini& ini, const unsigned _id = UINT_MAX); void ExportIni(QFile& fout) const; void SetName(const QString& n); bool SetFlyWarp(const unsigned f); bool SetType(const unsigned t); QString GetName() const; unsigned GetFlyWarp() const; unsigned GetType() const; bool SetTile(unsigned x, unsigned y, unsigned _id); bool InsertColumn(unsigned x); bool InsertRow(unsigned y); void AddColumn(); void AddRow(); bool DeleteColumn(unsigned x); bool DeleteRow(unsigned y); unsigned GetTile(unsigned x, unsigned y) const; unsigned GetWidth() const; unsigned GetHeight() const; const MapEffect* GetEffect(const unsigned i) const; unsigned GetEffectByID(const unsigned _id) const; unsigned GetEffectCount() const; const MapEffect* NewEffect(Ini* const ini = NULL); bool DeleteEffect(const unsigned i); const MapTrainer* GetTrainer(const unsigned i) const; unsigned GetTrainerByID(const unsigned _id) const; unsigned GetTrainerCount() const; const MapTrainer* NewTrainer(Ini* const ini = NULL); bool DeleteTrainer(const unsigned i); const MapWarp* GetWarp(const unsigned i) const; unsigned GetWarpByID(const unsigned _id) const; unsigned GetWarpCount() const; const MapWarp* NewWarp(Ini* const ini = NULL); bool DeleteWarp(const unsigned i); const MapWildList* GetWildList(const unsigned i) const; unsigned GetWildListByID(const unsigned _id) const; unsigned GetWildListCount() const; const MapWildList* NewWildList(Ini* const ini = NULL); bool DeleteWildList(const unsigned i); private: bool Validate(); QString name; unsigned flyWarp; unsigned type; Matrix tiles; QList effects; QList trainers; QList warps; QList wildLists; }; } } #endif