From e858d98977a09b3c8faf4df87ada4abc1399e8e5 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 22 May 2007 03:51:45 +0000 Subject: Added a lot of minor PokéMod modules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@12 6ecfd1a5-f3ed-3746-8530-beee90d26b22 --- Changelog | 14 +++ pokegen.cbp | 70 +++++++++++++ pokegen.depend | 70 +++++++++++++ pokegen.layout | 122 ++++++++++++++-------- pokemod/AbilityEffect.cpp | 2 +- pokemod/AbilityEffect.h | 2 +- pokemod/CoinList.cpp | 208 ++++++++++++++++++++++++++++++++++++++ pokemod/CoinList.h | 72 +++++++++++++ pokemod/ItemStorage.cpp | 152 ++++++++++++++++++++++++++++ pokemod/ItemStorage.h | 64 ++++++++++++ pokemod/Pokemod.cpp | 61 +++++++++++ pokemod/Pokemod.h | 141 ++++++++++++++++++++++++++ pokemod/PokemonAbility.cpp | 154 ++++++++++++++++++++++++++++ pokemod/PokemonAbility.h | 64 ++++++++++++ pokemod/PokemonEvolution.cpp | 235 +++++++++++++++++++++++++++++++++++++++++++ pokemod/PokemonEvolution.h | 75 ++++++++++++++ pokemod/PokemonItem.cpp | 26 ++--- pokemod/PokemonItem.h | 2 +- pokemod/PokemonMove.cpp | 179 ++++++++++++++++++++++++++++++++ pokemod/PokemonMove.h | 67 ++++++++++++ pokemod/PokemonNature.cpp | 154 ++++++++++++++++++++++++++++ pokemod/PokemonNature.h | 64 ++++++++++++ pokemod/Store.cpp | 2 +- pokemod/Store.h | 2 +- pokemod/Time.cpp | 2 +- pokemod/Time.h | 2 +- pokemod/Type.cpp | 2 +- pokemod/Type.h | 2 +- 28 files changed, 1945 insertions(+), 65 deletions(-) create mode 100644 pokegen.depend create mode 100644 pokemod/CoinList.cpp create mode 100644 pokemod/CoinList.h create mode 100644 pokemod/ItemStorage.cpp create mode 100644 pokemod/ItemStorage.h create mode 100644 pokemod/Pokemod.cpp create mode 100644 pokemod/Pokemod.h create mode 100644 pokemod/PokemonAbility.cpp create mode 100644 pokemod/PokemonAbility.h create mode 100644 pokemod/PokemonEvolution.cpp create mode 100644 pokemod/PokemonEvolution.h create mode 100644 pokemod/PokemonMove.cpp create mode 100644 pokemod/PokemonMove.h create mode 100644 pokemod/PokemonNature.cpp create mode 100644 pokemod/PokemonNature.h diff --git a/Changelog b/Changelog index 94610b44..7f6bffe8 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,17 @@ +----------------- +Rev: 12 +Date: 21 May 2007 +User: MathStuf +----------------- +[ADD] /pokemod/PokemonNature.{h, cpp} +[ADD] /pokemod/PokemonAbility.{h, cpp} +[ADD] /pokemod/ItemStorage.{h, cpp} +[ADD] /pokemod/PokemonMove.{h, cpp} +[ADD] /pokemod/PokemonEvolution.{h, cpp} +[ADD] /pokemod/Pokemod.{h, cpp} +[FIX] Header info directory paths +[ADD] /pokemod/CoinList.{h, cpp} + ----------------- Rev: 11 Date: 21 May 2007 diff --git a/pokegen.cbp b/pokegen.cbp index 2d99b4a1..df988269 100644 --- a/pokegen.cbp +++ b/pokegen.cbp @@ -117,6 +117,16 @@ + + + + @@ -141,6 +151,16 @@ + + + + @@ -168,6 +188,36 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/pokegen.depend b/pokegen.depend new file mode 100644 index 00000000..6be4bba4 --- /dev/null +++ b/pokegen.depend @@ -0,0 +1,70 @@ +# depslib dependency file v1.0 +1178468221 source:h:\ben\programming\pc\pokegen\src\pokemod\flag.cpp + "Flag.h" + +1178468213 h:\ben\programming\pc\pokegen\src\pokemod\flag.h + "Debug.h" + "Ini.h" + "Ref.h" + +1179710452 h:\ben\programming\pc\pokegen\src\pokemod\debug.h + + + + "String.h" + +1179711255 h:\ben\programming\pc\pokegen\src\pokemod\string.h + + + + + +1178918864 h:\ben\programming\pc\pokegen\src\pokemod\frac.h + "Debug.h" + "Ini.h" + +1178918733 h:\ben\programming\pc\pokegen\src\pokemod\ini.h + + + "String.h" + +1178916700 h:\ben\programming\pc\pokegen\src\pokemod\ref.h + + "String.h" + +1178467550 source:h:\ben\programming\pc\pokegen\src\pokemod\ini.cpp + "Ini.h" + +1178323177 source:h:\ben\programming\pc\pokegen\src\pokemod\object.cpp + "Object.h" + +1178915399 h:\ben\programming\pc\pokegen\src\pokemod\object.h + + + "Debug.h" + "Ini.h" + +1178468484 source:h:\ben\programming\pc\pokegen\src\pokemod\path.cpp + "Path.h" + +1178468481 h:\ben\programming\pc\pokegen\src\pokemod\path.h + + + "String.h" + +1178918794 source:h:\ben\programming\pc\pokegen\src\pokemod\point.cpp + "Point.h" + +1178918798 h:\ben\programming\pc\pokegen\src\pokemod\point.h + "Debug.h" + "Ini.h" + +1179711261 source:h:\ben\programming\pc\pokegen\src\pokemod\string.cpp + "String.h" + +1178918899 source:h:\ben\programming\pc\pokegen\src\pokemod\debug.cpp + "Debug.h" + +1178323168 source:h:\ben\programming\pc\pokegen\src\pokemod\ref.cpp + "Ref.h" + diff --git a/pokegen.layout b/pokegen.layout index 74587e8c..b3691d29 100644 --- a/pokegen.layout +++ b/pokegen.layout @@ -1,8 +1,8 @@ - + - + @@ -26,118 +26,160 @@ - + - + - + - + - + - + - + - + + + + + + + - + - + - + - + - + - + - + - + + + + + + + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + - + - + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + diff --git a/pokemod/AbilityEffect.cpp b/pokemod/AbilityEffect.cpp index c19b2f8a..45f45d3a 100644 --- a/pokemod/AbilityEffect.cpp +++ b/pokemod/AbilityEffect.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: AbilityEffect.cpp +// Name: pokemod/AbilityEffect.cpp // Purpose: Define an effect of an ability // Author: Ben Boeckel // Modified by: Ben Boeckel diff --git a/pokemod/AbilityEffect.h b/pokemod/AbilityEffect.h index 27d26f57..2306b35e 100644 --- a/pokemod/AbilityEffect.h +++ b/pokemod/AbilityEffect.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: AbilityEffect.h +// Name: pokemod/AbilityEffect.h // Purpose: Define an effect of an ability // Author: Ben Boeckel // Modified by: Ben Boeckel diff --git a/pokemod/CoinList.cpp b/pokemod/CoinList.cpp new file mode 100644 index 00000000..83748355 --- /dev/null +++ b/pokemod/CoinList.cpp @@ -0,0 +1,208 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: pokemod/CoinList.cpp +// Purpose: A specialty store where Pokémon and items can be gotten for +// coins won through gambling +// Author: Ben Boeckel +// Modified by: Ben Boeckel +// Created: Wed Feb 28 21:16:29 2007 +// Copyright: ©2007 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 2 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, write to the Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +///////////////////////////////////////////////////////////////////////////// + +#include "CoinList.h" + +extern PokeGen::PokeMod::Pokemod curPokeMod; + +PokeGen::PokeMod::CoinList::CoinList(unsigned _id) +{ + LogCtor("CoinList", _id); + name = ""; + value = 0; + items.clear(); + id = _id; +} + +PokeGen::PokeMod::CoinList::CoinList(Ini &ini, unsigned _id) +{ + LogCtorIni("CoinList", _id); + ImportIni(ini); + if(_id == UINT_MAX) + LogIdError("CoinList"); +} + +PokeGen::PokeMod::CoinList::~CoinList() +{ + LogDtor("CoinList", id, name); +} + +void PokeGen::PokeMod::CoinList::Validate() +{ + isValid = true; + LogValidateStart("CoinList", id, name); + if (name == "") + { + LogVarEmpty("CoinList", id, "name", name); + isValid = false; + } + if (GetCoinItemCount()) + { + for (unsigned i = 0; i < GetCoinItemCount(); ++i) + { + LogSubmoduleIterate("CoinList", id, "item", i, name); + if (!items[i].IsValid()) + isValid = false; + } + } + else + { + LogSubmoduleEmpty("CoinList", id, "items", name); + isValid = false; + } + LogValidateOver("CoinList", id, isValid, name); +} + +#ifdef PG_DEBUG_WINDOW +void PokeGen::PokeMod::CoinList::Validate(const wxListBox &output) +{ + isValid = true; + LogValidateStart("CoinList", id, name); + if (name == "") + { + LogVarEmpty("CoinList", id, "name", name); + output.Append(ConsoleLogVarEmpty("CoinList", id, "name", name)); + isValid = false; + } + if (GetCoinItemCount()) + { + for (unsigned i = 0; i < GetCoinItemCount(); ++i) + { + LogSubmoduleIterate("CoinList", id, "item", i, name); + if (!items[i].IsValid()) + isValid = false; + } + } + else + { + LogSubmoduleEmpty("CoinList", id, "items", name); + output.Append(ConsoleLogSubmoduleEmpty("CoinList", id, "items", name)); + isValid = false; + } + LogValidateOver("CoinList", id, isValid, name); +} +#endif + +void PokeGen::PokeMod::CoinList::ImportIni(Ini &ini, unsigned _id) +{ + LogImportStart("CoinList"); + if (_id == UINT_MAX) + { + ini.GetValue("id", id, UINT_MAX); + // Was there an id associated with the element? + if (id == UINT_MAX) + LogIdNotFound("CoinList"); + } + else + id = _id; + ini.GetValue("name", name, ""); + ini.GetValue("value", value, 0); + LogImportOver("CoinList", id, name); +} + +void PokeGen::PokeMod::CoinList::ExportIni(std::ofstream &fout) const +{ + LogExportStart("CoinList", id, name); + // Make elements + Ini exCoinList("coinList"); + exCoinList.AddField("id", id); + exCoinList.AddField("name", name); + exCoinList.AddField("value", value); + exCoinList.Export(fout); + for (std::vector::iterator i = effects.begin(); i != effects.end(); ++i) + i->ExportIni(fout, name); + LogExportOver("CoinList", id, name); +} + +void PokeGen::PokeMod::CoinList::SetName(const String &n) +{ + LogSetVar("CoinList", id, "name", n, name); + name = n; +} + +void PokeGen::PokeMod::CoinList::SetValue(unsigned v) +{ + LogSetVar("CoinList", id, "value", value, name); + value = v; +} + +PokeGen::PokeMod::String PokeGen::PokeMod::CoinList::GetName() const +{ + LogFetchVar("CoinList", id, "name", name, name); + return name; +} + +unsigned PokeGen::PokeMod::CoinList::GetValue() const +{ + LogFetchVar("CoinList", id, "value", value, name); + return value; +} + +PokeGen::PokeMod::CoinItem *PokeGen::PokeMod::CoinList::GetCoinItem(unsigned _id) +{ + LogSubmoduleFetch("CoinList", id, "item", _id, name); + for (unsigned i = 0; i < GetAbilityEffectCount(); ++i) + { + if (items[i].GetId() == _id) + return &items[i]; + } + LogSubmoduleFetch("CoinList", id, "item", _id, name); + return NULL; +} + +unsigned PokeGen::PokeMod::CoinList::GetCoinItemCount() const +{ + LogSubmoduleCount("CoinList", id, "items", name); + return items.size(); +} + +void PokeGen::PokeMod::CoinList::NewCoinItem(Ini *const ini) +{ + unsigned i = 0; + // Find the first unused ID in the vector + for (; i < GetCoinItemCount(); ++i) + { + if (!GetCoinItem(i)) + break; + } + CoinItem newCoinItem(i); + if (ini) + newCoinItem.ImportIni(*ini); + LogSubmoduleNew("CoinList", id, "item", i, name); + items.push_back(newCoinItem); +} + +void PokeGen::PokeMod::CoinList::DeleteCoinItem(unsigned _id) +{ + LogSubmoduleRemoveStart("CoinList", id, "item", _id, name); + for (std::vector::iterator i = items.begin(); i != items.end(); ++i) + { + if (i->GetId() == _id) + { + LogSubmoduleRemoved("CoinList", id, "item", _id, name); + effects.erase(i); + } + } + LogSubmoduleRemoveFail("CoinList", id, "item", _id, name); +} diff --git a/pokemod/CoinList.h b/pokemod/CoinList.h new file mode 100644 index 00000000..0b5f3aef --- /dev/null +++ b/pokemod/CoinList.h @@ -0,0 +1,72 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: pokemod/CoinList.h +// Purpose: A specialty store where Pokémon and items can be gotten for +// coins won through gambling +// Author: Ben Boeckel +// Modified by: Ben Boeckel +// Created: Wed Feb 28 21:16:29 2007 +// Copyright: ©2007 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 2 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, write to the Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +///////////////////////////////////////////////////////////////////////////// + +#ifndef __POKEMOD_COINLIST__ +#define __POKEMOD_COINLIST__ + +#include +#include "Object.h" +#include "String.h" +#include "Pokemod.h" +#include "CoinItem.h" + +namespace PokeGen +{ + namespace PokeMod + { + class CoinList : public Object + { + public: + CoinList(unsigned _id); + CoinList(Ini &ini, unsigned _id = UINT_MAX); + ~CoinList(); + + void ImportIni(Ini &ini, unsigned _id = UINT_MAX); + void ExportIni(std::ofstream &fout); + + void SetName(const String &n); + void SetValue(unsigned v); + + String GetName() const; + unsigned GetValue() const; + + CoinItem *GetCoinItem(unsigned _id); + unsigned GetCoinItemCount() const; + void NewCoinItem(Ini *const ini); + void DeleteCoinItem(unsigned _id); + private: + void Validate(); +# ifdef PG_DEBUG_WINDOW + void Validate(const wxListBox &output); +# endif + + String name; + unsigned value; + + std::vector items; + }; + } +} + +#endif diff --git a/pokemod/ItemStorage.cpp b/pokemod/ItemStorage.cpp new file mode 100644 index 00000000..b7466f3e --- /dev/null +++ b/pokemod/ItemStorage.cpp @@ -0,0 +1,152 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: pokemod/ItemStorage.cpp +// Purpose: Define a type of item and how much can be stored +// Author: Ben Boeckel +// Modified by: Ben Boeckel +// Created: Tue Mar 20 18:06:40 2007 +// Copyright: ©2007 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 2 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, write to the Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +///////////////////////////////////////////////////////////////////////////// + +#include "ItemStorage.h" + +PokeGen::PokeMod::ItemStorage::ItemStorage(unsigned _id) +{ + LogCtor("ItemStorage", _id); + name = ""; + computer = 0; + player = 1; + id = _id; +} + +PokeGen::PokeMod::ItemStorage::ItemStorage(Ini &ini, unsigned _id) +{ + LogCtorIni("ItemStorage", _id); + ImportIni(ini); + if(_id == UINT_MAX) + LogIdError("ItemStorage"); +} + +PokeGen::PokeMod::ItemStorage::~ItemStorage() +{ + LogDtor("ItemStorage", id, name); +} + +void PokeGen::PokeMod::ItemStorage::Validate() +{ + isValid = true; + LogValidateStart("ItemStorage", id, name); + if (name == "") + { + LogVarNotSet("ItemStorage", id, "name"); + isValid = false; + } + if (!player) + { + LogVarNotValid("ItemStorage", id, "player"); + isValid = false; + } + LogValidateOver("ItemStorage", id, isValid, name); +} + +#ifdef PG_DEBUG_WINDOW +void PokeGen::PokeMod::ItemStorage::Validate(const wxListBox &output) +{ + isValid = true; + LogValidateStart("ItemStorage", id, name); + if (name == "") + { + LogVarNotSet("ItemStorage", id, "name"); + output.Append(ConsoleLogVarNotSet("ItemStorage", id, "name")); + isValid = false; + } + if (!player) + { + LogVarNotValid("ItemStorage", id, "player"); + output.Append(ConsoleLogVarNotValid("ItemStorage", id, "player")); + isValid = false; + } + LogValidateOver("ItemStorage", id, isValid, name); +} +#endif + +void PokeGen::PokeMod::ItemStorage::ImportIni(Ini &ini, unsigned _id) +{ + LogImportStart("ItemStorage"); + if (_id == UINT_MAX) + { + ini.GetValue("id", id, UINT_MAX); + // Was there an id associated with the element? + if (id == UINT_MAX) + LogIdNotFound("ItemStorage"); + } + else + id = _id; + ini.GetValue("name", name, ""); + ini.GetValue("computer", computer, 0); + ini.GetValue("player", player, 1); + LogImportOver("ItemStorage", id, name); +} + +void PokeGen::PokeMod::ItemStorage::ExportIni(std::ofstream &fout) const +{ + LogExportStart("ItemStorage", id, name); + // Make elements + Ini exItemStorage("ItemStorage"); + exItemStorage.AddField("id", id); + exItemStorage.AddField("name", name); + exItemStorage.AddField("computer", computer); + exItemStorage.AddField("player", player); + exItemStorage.Export(fout); + LogExportOver("ItemStorage", id, name); +} + +void PokeGen::PokeMod::ItemStorage::SetName(const String &n) +{ + LogSetVar("ItemStorage", id, "name", n, name); + name = n; +} + +void PokeGen::PokeMod::ItemStorage::SetComputer(unsigned c) +{ + LogSetVar("ItemStorage", id, "computer", c, name); + computer = c; +} + +void PokeGen::PokeMod::ItemStorage::SetPlayer(unsigned p) +{ + LogSetVar("ItemStorage", id, "player", p, name); + if (p) + player = p; +} + +PokeGen::PokeMod::String PokeGen::PokeMod::ItemStorage::GetName() const +{ + LogFetchVar("ItemStorage", id, "name", name); + return name; +} + +unsigned PokeGen::PokeMod::ItemStorage::GetComputer() const +{ + LogFetchVar("ItemStorage", id, "computer", computer, name); + return computer; +} + +unsigned PokeGen::PokeMod::ItemStorage::GetPlayer() const +{ + LogFetchVar("ItemStorage", id, "player", player, name); + return player; +} diff --git a/pokemod/ItemStorage.h b/pokemod/ItemStorage.h new file mode 100644 index 00000000..808cb602 --- /dev/null +++ b/pokemod/ItemStorage.h @@ -0,0 +1,64 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: pokemod/ItemStorage.h +// Purpose: Define a type of item and how much can be stored +// Author: Ben Boeckel +// Modified by: Ben Boeckel +// Created: Tue Mar 20 18:06:40 2007 +// Copyright: ©2007 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 2 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, write to the Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +///////////////////////////////////////////////////////////////////////////// + +#ifndef __POKEMOD_ITEMSTORAGE__ +#define __POKEMOD_ITEMSTORAGE__ + +#include "Object.h" +#include "String.h" + +namespace PokeGen +{ + namespace PokeMod + { + class ItemStorage : public Object + { + public: + ItemStorage(unsigned _id); + ItemStorage(Ini &ini, unsigned _id = UINT_MAX); + ~ItemStorage(); + + void ImportIni(Ini &ini, unsigned _id = UINT_MAX); + void ExportIni(std::ofstream &fout) const; + + void SetName(const String &n); + void SetComputer(unsigned c); + void SetPlayer(unsigned p); + + String GetName() const; + unsigned GetComputer() const; + unsigned GetPlayer() const; + private: + void Validate(); +# ifdef POKEMODR + void Validate(const wxListBox &output); +# endif + + String name; + unsigned computer; + unsigned player; + }; + } +} + +#endif diff --git a/pokemod/Pokemod.cpp b/pokemod/Pokemod.cpp new file mode 100644 index 00000000..b62b3da7 --- /dev/null +++ b/pokemod/Pokemod.cpp @@ -0,0 +1,61 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: pokemod/Pokemod.cpp +// Purpose: +// Author: Ben Boeckel +// Modified by: Ben Boeckel +// Created: Sat Feb 24 21:41:19 2007 +// Copyright: ©2007 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 2 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, write to the Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +///////////////////////////////////////////////////////////////////////////// + +#include "Pokemod.h" + +PokeGen::PokeMod::PokeMod::Pokemod() +{ +} + +PokeGen::PokeMod::PokeMod::Pokemod(std::ifstream &fin) +{ + Log("Pokemod: Constructing by XML", PM_DEBUG_DEBUG); + ImportIni(fin); +} + +PokeGen::PokeMod::PokeMod::~Pokemod() +{ + LogDtor("Pokemod", 0); +} + +void Validate() +{ + // TODO (Validation#1#): Pokemod Validation +} + +#ifdef PG_DEBUG_WINDOW +void Validate(const wxListBox &output) +{ + // TODO (Validation#1#): Pokemod Validation +} +#endif + +void PokeGen::PokeMod::PokeMod::ImportIni(std::ifstream &fin) +{ + // TODO (Xml#1#): Import Pokemod from XML +} + +void PokeGen::PokeMod::PokeMod::ExportXml(std::ofstream &fout) +{ + // TODO (Xml#1#): Export Pokemod to XML +} diff --git a/pokemod/Pokemod.h b/pokemod/Pokemod.h new file mode 100644 index 00000000..d94bf794 --- /dev/null +++ b/pokemod/Pokemod.h @@ -0,0 +1,141 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: pokemod/Pokemod.h +// Purpose: +// Author: Ben Boeckel +// Modified by: Ben Boeckel +// Created: Sat Feb 24 21:41:19 2007 +// Copyright: ©2007 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 2 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, write to the Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +///////////////////////////////////////////////////////////////////////////// + +#ifndef __POKEMOD_POKEMOD__ +#define __POKEMOD_POKEMOD__ + +#include +#include "Object.h" +#include "Ref.h" +#include "Ability.h" +#include "Author.h" +#include "Badge.h" +#include "CoinList.h" +#include "Item.h" +#include "ItemStorage.h" +#include "Nature.h" +#include "Store.h" +#include "Time.h" +#include "Type.h" + +namespace PokeGen +{ + namespace PokeMod + { + class Pokemod : public Object + { + public: + Pokemod(); + Pokemod(std::ifstream &fin); + ~Pokemod(); + + void ImportIni(std::ifstream &fin); + void ExportIni(std::ofstream &fout); + + bool IsSpecialSplit(); + bool IsSpecialDVSplit(); + + Ability *GetAbility(unsigned _id); + Ability *GetAbility(const String &name); + unsigned GetAbilityCount(); + void NewAbility(); + void DeleteAbility(unsigned _id); + + Author *GetAuthor(unsigned _id); + Author *GetAuthor(const String &name); + unsigned GetAuthorCount(); + void NewAuthor(); + void DeleteAuthor(unsigned _id); + + Badge *GetBadge(unsigned _id); + Badge *GetBadge(const String &name); + unsigned GetBadgeCount(); + void NewBadge(); + void DeleteBadge(unsigned _id); + + CoinList *GetCoinList(unsigned _id); + CoinList *GetCoinList(const String &name); + unsigned GetCoinListCount(); + void NewCoinList(); + void DeleteCoinList(unsigned _id); + + Item *GetItem(unsigned _id); + Item *GetItem(const String &name); + unsigned GetItemCount(); + void NewItem(); + void DeleteItem(unsigned _id); + + ItemStorage *GetItemStorage(unsigned _id); + ItemStorage *GetItemStorage(const String &name); + unsigned GetItemStorageCount(); + void NewItemStorage(); + void DeleteItemStorage(unsigned _id); + + Nature *GetNature(unsigned _id); + Nature *GetNature(const String &name); + unsigned GetNatureCount(); + void NewNature(); + void DeleteNature(unsigned _id); + + Store *GetStore(unsigned _id); + Store *GetStore(const String &name); + unsigned GetStoreCount(); + void NewStore(); + void DeleteStore(unsigned _id); + + Time *GetTime(unsigned _id); + Time *GetTime(const String &name); + unsigned GetTimeCount(); + void NewTime(); + void DeleteTime(unsigned _id); + + Type *GetType(unsigned _id); + Type *GetType(const String &name); + unsigned GetTypeCount(); + void NewType(); + void DeleteType(unsigned _id); + private: + void Validate(); +# ifdef POKEMODR + void Validate(const wxListBox &output); +# endif + + bool splitSpecial; + bool splitSpecialDV; + + std::vector abilities; + std::vector authors; + std::vector badges; + std::vector coinLists; + std::vector items; + std::vector itemStorage; + std::vector natures; + std::vector pokemon; + std::vector stores; + std::vector