///////////////////////////////////////////////////////////////////////////// // Name: pokemod/Pokemod.h // Purpose: Define a custom PokéMod for PokéGen // Author: Ben Boeckel // Modified by: Ben Boeckel // Created: Sat Feb 24 21:41:19 2007 // Copyright: ©2007-2008 Ben Boeckel and 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_POKEMOD__ #define __POKEMOD_POKEMOD__ #include #include #include #include "../general/Exception.h" #include "../general/FracMatrix.h" #include "../general/Point.h" #include "Object.h" #include "Ability.h" #include "Author.h" #include "Badge.h" #include "CoinList.h" #include "Dialog.h" #include "EggGroup.h" #include "Item.h" #include "ItemType.h" #include "Map.h" #include "Move.h" #include "Nature.h" #include "Rules.h" #include "Species.h" #include "Store.h" #include "Tile.h" #include "Time.h" #include "Type.h" class Pokemod : public Object { public: enum Validation { V_Msg = 0, V_Warn = 1, V_Error = 2, V_End = 3 }; static const QStringList ValidationStr; Pokemod(); Pokemod(const QString& fpath); void load(const QString& fpath, const unsigned = 0) throw(Exception); void save() const throw(Exception); QString getPath() const; unsigned maxCompatability(const Pokemod& p) const; void validationMsg(const QString& msg, Validation val = V_Error) const throw(Exception); void setValOutput(QStringList& s); void unsetValOutput(); void setTitle(const QString& t); void setVersion(const QString& v); void setDescription(const QString& d); void setStartMap(const unsigned s) throw(BoundsException); void setStartWarp(const unsigned s) throw(BoundsException); void setWalkSkin(const QString& fname) throw(Exception); void setBikeSkin(const QString& fname) throw(Exception); void setSurfSkin(const QString& fname) throw(Exception); void setFlySkin(const QString& fname) throw(Exception); void setFishSkin(const QString& fname) throw(Exception); void setSurfFishSkin(const QString& fname) throw(Exception); void setSuperPCUname(const QString& u); void setSuperPCPasswd(const QString& p); void setTypeChart(const unsigned att, const unsigned def, const unsigned n, const unsigned d) throw(Exception); void setTypeChartNum(const unsigned att, const unsigned def, const unsigned n) throw(Exception); void setTypeChartDenom(const unsigned att, const unsigned def, const unsigned d) throw(Exception); void setRules(const Rules& r); void setRules(const QString& fname); QString getTitle() const; QString getVersion() const; QString getDescription() const; unsigned getStartMap() const; unsigned getStartWarp() const; QString getSuperPCUname() const; QString getSuperPCPasswd() const; const FracMatrix& getTypeChart() const; FracMatrix& getTypeChart(); Frac getTypeChart(const unsigned att, const unsigned def) const; const Rules& getRules() const; Rules& getRules(); const Ability& getAbility(const unsigned i) const throw(IndexException); Ability& getAbility(const unsigned i) throw(IndexException); const Ability& getAbilityByID(const unsigned i) const throw(IndexException); Ability& getAbilityByID(const unsigned i) throw(IndexException); unsigned getAbilityIndex(const unsigned i) const; unsigned getAbilityCount() const; Ability& newAbility(); Ability& newAbility(const QString& fname); Ability& newAbility(const Ability& a); void deleteAbility(const unsigned i) throw(IndexException); const Author& getAuthor(const unsigned i) const throw(IndexException); Author& getAuthor(const unsigned i) throw(IndexException); const Author& getAuthorByID(const unsigned i) const throw(IndexException); Author& getAuthorByID(const unsigned i) throw(IndexException); unsigned getAuthorIndex(const unsigned i) const; unsigned getAuthorCount() const; Author& newAuthor(); Author& newAuthor(const QString& fname); Author& newAuthor(const Author& a); void deleteAuthor(const unsigned i) throw(IndexException); const Badge& getBadge(const unsigned i) const throw(IndexException); Badge& getBadge(const unsigned i) throw(IndexException); const Badge& getBadgeByID(const unsigned i) const throw(IndexException); Badge& getBadgeByID(const unsigned i) throw(IndexException); unsigned getBadgeIndex(const unsigned i) const; unsigned getBadgeCount() const; Badge& newBadge(); Badge& newBadge(const QString& fname); Badge& newBadge(const Badge& b); void deleteBadge(const unsigned i) throw(IndexException); const CoinList& getCoinList(const unsigned i) const throw(IndexException); CoinList& getCoinList(const unsigned i) throw(IndexException); const CoinList& getCoinListByID(const unsigned i) const throw(IndexException); CoinList& getCoinListByID(const unsigned i) throw(IndexException); unsigned getCoinListIndex(const unsigned i) const; unsigned getCoinListCount() const; CoinList& newCoinList(); CoinList& newCoinList(const QString& fname); CoinList& newCoinList(const CoinList& c); void deleteCoinList(const unsigned i) throw(IndexException); const Dialog& getDialog(const unsigned i) const throw(IndexException); Dialog& getDialog(const unsigned i) throw(IndexException); const Dialog& getDialogByID(const unsigned i) const throw(IndexException); Dialog& getDialogByID(const unsigned i) throw(IndexException); unsigned getDialogIndex(const unsigned i) const; unsigned getDialogCount() const; Dialog& newDialog(); Dialog& newDialog(const QString& fname); Dialog& newDialog(const Dialog& d); void deleteDialog(const unsigned i) throw(IndexException); const EggGroup& getEggGroup(const unsigned i) const throw(IndexException); EggGroup& getEggGroup(const unsigned i) throw(IndexException); const EggGroup& getEggGroupByID(const unsigned i) const throw(IndexException); EggGroup& getEggGroupByID(const unsigned i) throw(IndexException); unsigned getEggGroupIndex(const unsigned i) const; unsigned getEggGroupCount() const; EggGroup& newEggGroup(); EggGroup& newEggGroup(const QString& fname); EggGroup& newEggGroup(const EggGroup& e); void deleteEggGroup(const unsigned i) throw(IndexException); const Item& getItem(const unsigned i) const throw(IndexException); Item& getItem(const unsigned i) throw(IndexException); const Item& getItemByID(const unsigned i) const throw(IndexException); Item& getItemByID(const unsigned i) throw(IndexException); unsigned getItemIndex(const unsigned i) const; unsigned getItemCount() const; Item& newItem(); Item& newItem(const QString& fname); Item& newItem(const Item& i); void deleteItem(const unsigned i) throw(IndexException); const ItemType& getItemType(const unsigned i) const throw(IndexException); ItemType& getItemType(const unsigned i) throw(IndexException); const ItemType& getItemTypeByID(const unsigned i) const throw(IndexException); ItemType& getItemTypeByID(const unsigned i) throw(IndexException); unsigned getItemTypeIndex(const unsigned i) const; unsigned getItemTypeCount() const; ItemType& newItemType(); ItemType& newItemType(const QString& fname); ItemType& newItemType(const ItemType& i); void deleteItemType(const unsigned i) throw(IndexException); const Map& getMap(const unsigned i) const throw(IndexException); Map& getMap(const unsigned i) throw(IndexException); const Map& getMapByID(const unsigned i) const throw(IndexException); Map& getMapByID(const unsigned i) throw(IndexException); unsigned getMapIndex(const unsigned i) const; unsigned getMapCount() const; Map& newMap(); Map& newMap(const QString& fname); Map& newMap(const Map& m); void deleteMap(const unsigned i) throw(IndexException); const Move& getMove(const unsigned i) const throw(IndexException); Move& getMove(const unsigned i) throw(IndexException); const Move& getMoveByID(const unsigned i) const throw(IndexException); Move& getMoveByID(const unsigned i) throw(IndexException); unsigned getMoveIndex(const unsigned i) const; unsigned getMoveCount() const; Move& newMove(); Move& newMove(const QString& fname); Move& newMove(const Move& m); void deleteMove(const unsigned i) throw(IndexException); const Nature& getNature(const unsigned i) const throw(IndexException); Nature& getNature(const unsigned i) throw(IndexException); const Nature& getNatureByID(const unsigned i) const throw(IndexException); Nature& getNatureByID(const unsigned i) throw(IndexException); unsigned getNatureIndex(const unsigned i) const; unsigned getNatureCount() const; Nature& newNature(); Nature& newNature(const QString& fname); Nature& newNature(const Nature& n); void deleteNature(const unsigned i) throw(IndexException); const Species& getSpecies(const unsigned i) const throw(IndexException); Species& getSpecies(const unsigned i) throw(IndexException); const Species& getSpeciesByID(const unsigned i) const throw(IndexException); Species& getSpeciesByID(const unsigned i) throw(IndexException); unsigned getSpeciesIndex(const unsigned i) const; unsigned getSpeciesCount() const; Species& newSpecies(); Species& newSpecies(const QString& fname); Species& newSpecies(const Species& s); void deleteSpecies(const unsigned i) throw(IndexException); const Store& getStore(const unsigned i) const throw(IndexException); Store& getStore(const unsigned i) throw(IndexException); const Store& getStoreByID(const unsigned i) const throw(IndexException); Store& getStoreByID(const unsigned i) throw(IndexException); unsigned getStoreIndex(const unsigned i) const; unsigned getStoreCount() const; Store& newStore(); Store& newStore(const QString& fname); Store& newStore(const Store& s); void deleteStore(const unsigned i) throw(IndexException); const Tile& getTile(const unsigned i) const throw(IndexException); Tile& getTile(const unsigned i) throw(IndexException); const Tile& getTileByID(const unsigned i) const throw(IndexException); Tile& getTileByID(const unsigned i) throw(IndexException); unsigned getTileIndex(const unsigned i) const; unsigned getTileCount() const; Tile& newTile(); Tile& newTile(const QString& fname); Tile& newTile(const Tile& t); void deleteTile(const unsigned i) throw(IndexException); const Time& getTime(const unsigned i) const throw(IndexException); Time& getTime(const unsigned i) throw(IndexException); const Time& getTimeByID(const unsigned i) const throw(IndexException); Time& getTimeByID(const unsigned i) throw(IndexException); unsigned getTimeIndex(const unsigned i) const; unsigned getTimeCount() const; Time& newTime(); Time& newTime(const QString& fname); Time& newTime(const Time& t); void deleteTime(const unsigned i) throw(IndexException); const Type& getType(const unsigned i) const throw(IndexException); Type& getType(const unsigned i) throw(IndexException); const Type& getTypeByID(const unsigned i) const throw(IndexException); Type& getTypeByID(const unsigned i) throw(IndexException); unsigned getTypeIndex(const unsigned i) const; unsigned getTypeCount() const; Type& newType(); Type& newType(const QString& fname); Type& newType(const Type& t); void deleteType(const unsigned i) throw(IndexException); private: QStringList* valOutput; bool validate() const; unsigned getNewAbilityId() const; unsigned getNewAuthorId() const; unsigned getNewBadgeId() const; unsigned getNewCoinListId() const; unsigned getNewDialogId() const; unsigned getNewEggGroupId() const; unsigned getNewItemId() const; unsigned getNewItemTypeId() const; unsigned getNewMapId() const; unsigned getNewMoveId() const; unsigned getNewNatureId() const; unsigned getNewSpeciesId() const; unsigned getNewStoreId() const; unsigned getNewTileId() const; unsigned getNewTimeId() const; unsigned getNewTypeId() const; QString title; QString version; QString description; unsigned startMap; unsigned startWarp; QString superPCUname; QString superPCPasswd; FracMatrix typeChart; Rules rules; QList abilities; QList authors; QList badges; QList coinLists; QList dialogs; QList eggGroups; QList items; QList itemTypes; QList maps; QList moves; QList natures; QList species; QList stores; QList tiles; QList