diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2007-06-04 01:35:20 +0000 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2007-06-04 01:35:20 +0000 |
| commit | 3595239f08f2bc1df32ef22ed6de9bde10ca3384 (patch) | |
| tree | d9962c84e3a1f19e2da422f9bb49f65c21ada9f6 /pokemod/Pokemod.cpp | |
| parent | c9afda3ab74614fb36986f96b7972c082f275eca (diff) | |
| download | sigen-3595239f08f2bc1df32ef22ed6de9bde10ca3384.tar.gz sigen-3595239f08f2bc1df32ef22ed6de9bde10ca3384.tar.xz sigen-3595239f08f2bc1df32ef22ed6de9bde10ca3384.zip | |
Style cleanup, minor Matrix fixes, duplication validations, Pokemod methods
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@19 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemod/Pokemod.cpp')
| -rw-r--r-- | pokemod/Pokemod.cpp | 2611 |
1 files changed, 2607 insertions, 4 deletions
diff --git a/pokemod/Pokemod.cpp b/pokemod/Pokemod.cpp index 4799fd89..615fb565 100644 --- a/pokemod/Pokemod.cpp +++ b/pokemod/Pokemod.cpp @@ -1,6 +1,6 @@ /////////////////////////////////////////////////////////////////////////////
// Name: pokemod/Pokemod.cpp
-// Purpose:
+// Purpose: Define a custom PokéMod for PokéGen
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Sat Feb 24 21:41:19 2007
@@ -23,7 +23,54 @@ #include "Pokemod.h"
-PokeGen::PokeMod::Pokemod::Pokemod()
+PokeGen::PokeMod::Pokemod::Pokemod() :
+ title(""),
+ version(""),
+ description(""),
+ genderAllowed(false),
+ breedingAllowed(false),
+ eggSpecies(UINT_MAX),
+ holdItems(false),
+ criticalDomains(false),
+ contestAllowed(false),
+ abilityAllowed(false),
+ natureAllowed(false),
+ numDaycares(0),
+ numPokemonBoxes(0),
+ numPokemonPerBox(1),
+ maxParty(1),
+ maxFight(1),
+ maxMoves(1),
+ maxLevel(1),
+ maxMoney(0),
+ hardCash(false),
+ specialSplit(false),
+ specialDVSplit(false),
+ maxDVValue(16),
+ happiness(false),
+ happyFaintLoss(0),
+ happyLevelGain(0),
+ happySteps(0),
+ effortValuesAllowed(false),
+ maxTotalEV(0),
+ maxEVPerStat(0),
+ pokerusChance(1, 1),
+ startMap(UINT_MAX),
+ startMoney(0),
+ startCoordinate(0, 0),
+ startDirection(UINT_MAX),
+ startDialog(UINT_MAX),
+ walkSkin(""),
+ bikeSkin(""),
+ surfSkin(""),
+ flySkin(""),
+ fishSkin(""),
+ surfFishSkin(""),
+ superPCUname(""),
+ superPCPasswd(""),
+ struggleMove(UINT_MAX),
+ confuseMove(UINT_MAX),
+ typeChart(1, 1, Frac(1, 1, true))
{
LogCtor("Pokemod", 0);
}
@@ -43,6 +90,7 @@ void PokeGen::PokeMod::Pokemod::Validate() {
LogValidateStart("Pokemod", 0);
// TODO (Validation#1#): Pokemod Validation
+# warning "Pokemod Validation"
LogValidateOver("Pokemod", 0, isValid);
}
@@ -55,10 +103,2565 @@ void PokeGen::PokeMod::Pokemod::Validate(const wxListBox &output) void PokeGen::PokeMod::Pokemod::ImportIni(std::ifstream &fin)
{
- // TODO (Ini#1#): Import Pokemod
+ LogImportStart("Pokemod");
+ std::vector<Ini> sections;
+ Ini meta("unset");
+ while (fin.peek() != '\n')
+ {
+ Ini curSection(fin);
+ if (curSection.GetName() == "pokemod")
+ {
+ if (meta.GetName() == "unset")
+ {
+ Log(String("Pokemod: Multiple meta data sections in PokéMod file"), PM_DEBUG_ERROR);
+ return;
+ }
+ meta = curSection;
+ unsigned i;
+ unsigned j;
+ curSection.GetValue("title", title);
+ curSection.GetValue("version", version);
+ curSection.GetValue("description", description);
+ curSection.GetValue("genderAllowed", genderAllowed, false);
+ curSection.GetValue("breedingAllowed", breedingAllowed, false);
+ curSection.GetValue("eggSpecies", eggSpecies);
+ curSection.GetValue("holdItems", holdItems, false);
+ curSection.GetValue("criticalDomains", criticalDomains, false);
+ curSection.GetValue("contestAllowed", contestAllowed, false);
+ curSection.GetValue("abilityAllowed", abilityAllowed, false);
+ curSection.GetValue("natureAllowed", natureAllowed, false);
+ curSection.GetValue("numDaycares", numDaycares, 0);
+ curSection.GetValue("numPokemonBoxes", numPokemonBoxes, 0);
+ curSection.GetValue("numPokemonPerBox", numPokemonPerBox, 1);
+ curSection.GetValue("maxParty", maxParty, 1);
+ curSection.GetValue("maxFight", maxFight, 1);
+ curSection.GetValue("maxMoves", maxMoves, 1);
+ curSection.GetValue("maxLevel", maxLevel, 0);
+ curSection.GetValue("maxMoney", maxMoney, 0);
+ curSection.GetValue("hardCash", hardCash, false);
+ curSection.GetValue("specialSplit", specialSplit, false);
+ curSection.GetValue("specialDVSplit", specialDVSplit, false);
+ curSection.GetValue("maxDVValue", maxDVValue, 16);
+ curSection.GetValue("happiness", happiness, false);
+ curSection.GetValue("happyFaintLoss", happyFaintLoss, 0);
+ curSection.GetValue("happyLevelGain", happyLevelGain, 0);
+ curSection.GetValue("happySteps", happySteps, 0);
+ curSection.GetValue("effortValuesAllowed", effortValuesAllowed, false);
+ curSection.GetValue("maxTotalEV", maxTotalEV, 0);
+ curSection.GetValue("maxEVPerStat", maxEVPerStat, 0);
+ curSection.GetValue("pokerusChance-n", i, 1);
+ curSection.GetValue("pokerusChance-d", j, 1);
+ pokerusChance.Set(i, j);
+ curSection.GetValue("startMap", startMap);
+ curSection.GetValue("startMoney", startMoney, 0);
+ curSection.GetValue("startCoordinate-x", i, 0);
+ curSection.GetValue("startCoordinate-y", j, 0);
+ startCoordinate.Set(i, j);
+ curSection.GetValue("startDirection", startDirection);
+ curSection.GetValue("startDialog", startDialog);
+ curSection.GetValue("walkSkin", walkSkin);
+ curSection.GetValue("bikeSkin", bikeSkin);
+ curSection.GetValue("surfSkin", surfSkin);
+ curSection.GetValue("flySkin", flySkin);
+ curSection.GetValue("fishSkin", fishSkin);
+ curSection.GetValue("surfFishSkin", surfFishSkin);
+ curSection.GetValue("superPCUname", superPCUname);
+ curSection.GetValue("superPCPasswd", superPCPasswd);
+ curSection.GetValue("struggleMove", struggleMove);
+ curSection.GetValue("confuseMove", confuseMove);
+ }
+ else if (curSection.GetName() == "ability")
+ NewAbility(&curSection);
+ else if (curSection.GetName() == "author")
+ NewAuthor(&curSection);
+ else if (curSection.GetName() == "badge")
+ NewBadge(&curSection);
+ else if (curSection.GetName() == "coinList")
+ NewCoinList(&curSection);
+ else if (curSection.GetName() == "dialog")
+ NewDialog(&curSection);
+ else if (curSection.GetName() == "eggGroup")
+ NewEggGroup(&curSection);
+ else if (curSection.GetName() == "item")
+ NewItem(&curSection);
+ else if (curSection.GetName() == "itemStorage")
+ NewItemStorage(&curSection);
+ else if (curSection.GetName() == "map")
+ NewMap(&curSection);
+ else if (curSection.GetName() == "move")
+ NewMove(&curSection);
+ else if (curSection.GetName() == "nature")
+ NewNature(&curSection);
+ else if (curSection.GetName() == "pokemon")
+ NewPokemon(&curSection);
+ else if (curSection.GetName() == "status")
+ NewStatus(&curSection);
+ else if (curSection.GetName() == "store")
+ NewStore(&curSection);
+ else if (curSection.GetName() == "tile")
+ NewTile(&curSection);
+ else if (curSection.GetName() == "time")
+ NewTime(&curSection);
+ else if (curSection.GetName() == "type")
+ NewType(&curSection);
+ else
+ sections.push_back(curSection);
+ }
+ if (meta.GetName() == "unset")
+ {
+ Log(String("Pokemod: No meta data found in PokéMod file"), PM_DEBUG_ERROR);
+ return;
+ }
+ for (std::vector<Type>::iterator i = types.begin(); i != types.end(); ++i)
+ {
+ for (std::vector<Type>::iterator j = types.begin(); j != types.end(); ++j)
+ {
+ unsigned k;
+ unsigned l;
+ meta.GetValue(String("typeChart-%u-%u-n", i->GetId(), j->GetId()), k, 1);
+ meta.GetValue(String("typeChart-%u-%u-d", i->GetId(), j->GetId()), l, 1);
+ SetTypeChart(i->GetId(), j->GetId(), k, l);
+ }
+ }
+ std::stringstream ss;
+ std::string s;
+ std::string s1;
+ unsigned u;
+ for (std::vector<Ini>::iterator i = sections.begin(); i != sections.end(); ++i)
+ {
+ ss.write(i->GetName().c_str(), i->GetName().length());
+ ss >> s;
+ ss >> s1;
+ if (s == "abilityEffect")
+ {
+ if (Ability *a = (Ability *)GetAbility(s1))
+ a->NewAbilityEffect(&*i);
+ sections.erase(i);
+ }
+ else if (s == "coinItem")
+ {
+ if (CoinList *c = (CoinList *)GetCoinList(s1))
+ c->NewCoinItem(&*i);
+ sections.erase(i);
+ }
+ else if (s == "itemEffect")
+ {
+ if (Item *it = (Item *)GetItem(s1))
+ it->NewItemEffect(&*i);
+ sections.erase(i);
+ }
+ else if (s == "mapEffect")
+ {
+ if (Map *m = (Map *)GetMap(s1))
+ m->NewMapEffect(&*i);
+ sections.erase(i);
+ }
+ else if (s == "mapTrainer")
+ {
+ if (Map *m = (Map *)GetMap(s1))
+ m->NewMapTrainer(&*i);
+ sections.erase(i);
+ }
+ else if (s == "mapWarp")
+ {
+ if (Map *m = (Map *)GetMap(s1))
+ m->NewMapWarp(&*i);
+ sections.erase(i);
+ }
+ else if (s == "mapWildList")
+ {
+ if (Map *m = (Map *)GetMap(s1))
+ m->NewMapWildList(&*i);
+ sections.erase(i);
+ }
+ else if (s == "moveEffect")
+ {
+ if (Move *m = (Move *)GetMove(s1))
+ m->NewMoveEffect(&*i);
+ sections.erase(i);
+ }
+ else if (s == "natureEffect")
+ {
+ if (Nature *n = (Nature *)GetNature(s1))
+ n->NewNatureEffect(&*i);
+ sections.erase(i);
+ }
+ else if (s == "pokemonAbility")
+ {
+ if (Pokemon *p = (Pokemon *)GetPokemon(s1))
+ p->NewPokemonAbility(&*i);
+ sections.erase(i);
+ }
+ else if (s == "pokemonEvolution")
+ {
+ if (Pokemon *p = (Pokemon *)GetPokemon(s1))
+ p->NewPokemonEvolution(&*i);
+ sections.erase(i);
+ }
+ else if (s == "pokemonItem")
+ {
+ if (Pokemon *p = (Pokemon *)GetPokemon(s1))
+ p->NewPokemonItem(&*i);
+ sections.erase(i);
+ }
+ else if (s == "pokemonMove")
+ {
+ if (Pokemon *p = (Pokemon *)GetPokemon(s1))
+ p->NewPokemonMove(&*i);
+ sections.erase(i);
+ }
+ else if (s == "pokemonNature")
+ {
+ if (Pokemon *p = (Pokemon *)GetPokemon(s1))
+ p->NewPokemonNature(&*i);
+ sections.erase(i);
+ }
+ else if (s == "statusEffect")
+ {
+ if (Status *st = (Status *)GetStatus(s1))
+ st->NewStatusEffect(&*i);
+ sections.erase(i);
+ }
+ ss.clear();
+ }
+ for (std::vector<Ini>::iterator i = sections.begin(); i != sections.end(); ++i)
+ {
+ if (s == "mapTrainerTeam")
+ {
+ ss >> u;
+ if (const Map *m = GetMap(s1))
+ {
+ if (MapTrainer *t = (MapTrainer *)m->GetMapTrainer(u))
+ t->NewMapTrainerTeam(&*i);
+ }
+ sections.erase(i);
+ }
+ else if (s == "mapWildPokemon")
+ {
+ ss >> u;
+ if (const Map *m = GetMap(s1))
+ {
+ if (MapWildList *t = (MapWildList *)m->GetMapWildList(u))
+ t->NewMapWildPokemon(&*i);
+ }
+ sections.erase(i);
+ }
+ }
+ for (std::vector<Ini>::iterator i = sections.begin(); i != sections.end(); ++i)
+ Log(String("Pokemod: Unused INI section named \"%s\"", i->GetName().c_str()), PM_DEBUG_INFO);
+ LogImportOver("Pokemod", 0, title);
}
void PokeGen::PokeMod::Pokemod::ExportIni(std::ofstream &fout) const
{
- // TODO (Ini#1#): Export Pokemod
+ LogExportStart("Pokemod", 0, title);
+ Ini exPokemod("pokemod");
+ exPokemod.AddField("title", title);
+ exPokemod.AddField("version", version);
+ exPokemod.AddField("description", description);
+ exPokemod.AddField("genderAllowed", genderAllowed);
+ exPokemod.AddField("breedingAllowed", breedingAllowed);
+ exPokemod.AddField("eggSpecies", eggSpecies);
+ exPokemod.AddField("holdItems", holdItems);
+ exPokemod.AddField("criticalDomains", criticalDomains);
+ exPokemod.AddField("contestAllowed", contestAllowed);
+ exPokemod.AddField("abilityAllowed", abilityAllowed);
+ exPokemod.AddField("natureAllowed", natureAllowed);
+ exPokemod.AddField("numDaycares", numDaycares);
+ exPokemod.AddField("numPokemonBoxes", numPokemonBoxes);
+ exPokemod.AddField("numPokemonPerBox", numPokemonPerBox);
+ exPokemod.AddField("maxParty", maxParty);
+ exPokemod.AddField("maxFight", maxFight);
+ exPokemod.AddField("maxMoves", maxMoves);
+ exPokemod.AddField("maxLevel", maxLevel);
+ exPokemod.AddField("maxMoney", maxMoney);
+ exPokemod.AddField("hardCash", hardCash);
+ exPokemod.AddField("specialSplit", specialSplit);
+ exPokemod.AddField("specialDVSplit", specialDVSplit);
+ exPokemod.AddField("maxDVValue", maxDVValue);
+ exPokemod.AddField("happiness", happiness);
+ exPokemod.AddField("happyFaintLoss", happyFaintLoss);
+ exPokemod.AddField("happyLevelGain", happyLevelGain);
+ exPokemod.AddField("happySteps", happySteps);
+ exPokemod.AddField("effortValuesAllowed", effortValuesAllowed);
+ exPokemod.AddField("maxTotalEV", maxTotalEV);
+ exPokemod.AddField("maxEVPerStat", maxEVPerStat);
+ exPokemod.AddField("pokerusChance-n", pokerusChance.GetNum());
+ exPokemod.AddField("pokerusChance-d", pokerusChance.GetDenom());
+ exPokemod.AddField("startMap", startMap);
+ exPokemod.AddField("startMoney", startMoney);
+ exPokemod.AddField("startCoordinate-x", startCoordinate.GetX());
+ exPokemod.AddField("startCoordinate-y", startCoordinate.GetY());
+ exPokemod.AddField("startDirection", startDirection);
+ exPokemod.AddField("startDialog", startDialog);
+ exPokemod.AddField("walkSkin", walkSkin);
+ exPokemod.AddField("bikeSkin", bikeSkin);
+ exPokemod.AddField("surfSkin", surfSkin);
+ exPokemod.AddField("flySkin", flySkin);
+ exPokemod.AddField("fishSkin", fishSkin);
+ exPokemod.AddField("surfFishSkin", surfFishSkin);
+ exPokemod.AddField("superPCUname", superPCUname);
+ exPokemod.AddField("superPCPasswd", superPCPasswd);
+ exPokemod.AddField("struggleMove", struggleMove);
+ exPokemod.AddField("confuseMove", confuseMove);
+ for (unsigned i = 1; i < typeChart.GetWidth(); ++i)
+ {
+ for (unsigned j = 1; j < typeChart.GetHeight(); ++j)
+ {
+ exPokemod.AddField(String("typeChart-%u-%u-n", typeChart[i][0].GetNum(), typeChart[0][j].GetNum()), typeChart[i][j].GetNum());
+ exPokemod.AddField(String("typeChart-%u-%u-d", typeChart[i][0].GetNum(), typeChart[0][j].GetNum()), typeChart[i][j].GetDenom());
+ }
+ }
+ exPokemod.Export(fout);
+ for (std::vector<Ability>::const_iterator i = abilities.begin(); i != abilities.end(); ++i)
+ i->ExportIni(fout);
+ for (std::vector<Author>::const_iterator i = authors.begin(); i != authors.end(); ++i)
+ i->ExportIni(fout);
+ for (std::vector<Badge>::const_iterator i = badges.begin(); i != badges.end(); ++i)
+ i->ExportIni(fout);
+ for (std::vector<CoinList>::const_iterator i = coinLists.begin(); i != coinLists.end(); ++i)
+ i->ExportIni(fout);
+ for (std::vector<Dialog>::const_iterator i = dialogs.begin(); i != dialogs.end(); ++i)
+ i->ExportIni(fout);
+ for (std::vector<EggGroup>::const_iterator i = eggGroups.begin(); i != eggGroups.end(); ++i)
+ i->ExportIni(fout);
+ for (std::vector<Item>::const_iterator i = items.begin(); i != items.end(); ++i)
+ i->ExportIni(fout);
+ for (std::vector<ItemStorage>::const_iterator i = itemStorages.begin(); i != itemStorages.end(); ++i)
+ i->ExportIni(fout);
+ for (std::vector<Map>::const_iterator i = maps.begin(); i != maps.end(); ++i)
+ i->ExportIni(fout);
+ for (std::vector<Move>::const_iterator i = moves.begin(); i != moves.end(); ++i)
+ i->ExportIni(fout);
+ for (std::vector<Nature>::const_iterator i = natures.begin(); i != natures.end(); ++i)
+ i->ExportIni(fout);
+ for (std::vector<Pokemon>::const_iterator i = pokemon.begin(); i != pokemon.end(); ++i)
+ i->ExportIni(fout);
+ for (std::vector<Status>::const_iterator i = statuses.begin(); i != statuses.end(); ++i)
+ i->ExportIni(fout);
+ for (std::vector<Store>::const_iterator i = stores.begin(); i != stores.end(); ++i)
+ i->ExportIni(fout);
+ for (std::vector<Tile>::const_iterator i = tiles.begin(); i != tiles.end(); ++i)
+ i->ExportIni(fout);
+ for (std::vector<Time>::const_iterator i = times.begin(); i != times.end(); ++i)
+ i->ExportIni(fout);
+ for (std::vector<Type>::const_iterator i = types.begin(); i != types.end(); ++i)
+ i->ExportIni(fout);
+ LogExportOver("Pokemod", 0, title);
+}
+
+void PokeGen::PokeMod::Pokemod::SetTitle(const String &t)
+{
+ LogSetVar("Pokemod", 0, "title", t);
+ title = t;
+}
+
+void PokeGen::PokeMod::Pokemod::SetVersion(const String &v)
+{
+ LogSetVar("Pokemod", 0, "version", v);
+ version = v;
+}
+
+void PokeGen::PokeMod::Pokemod::SetDescription(const String &d)
+{
+ LogSetVar("Pokemod", 0, "description", d);
+ description = d;
+}
+
+void PokeGen::PokeMod::Pokemod::SetIsGenderAllowed(const bool g)
+{
+ LogSetVar("Pokemod", 0, "genderAllowed", g);
+ genderAllowed = g;
+}
+
+void PokeGen::PokeMod::Pokemod::SetIsBreedingAllowed(const bool b)
+{
+ LogSetVar("Pokemod", 0, "breedingAllowed", b);
+ breedingAllowed = b;
+}
+
+void PokeGen::PokeMod::Pokemod::SetEggSpecies(const unsigned e)
+{
+ LogSetVar("Pokemod", 0, "eggSpecies", e);
+ if (GetPokemon(e))
+ eggSpecies = e;
+}
+
+void PokeGen::PokeMod::Pokemod::SetEggSpecies(const String &e)
+{
+ LogSetVar("Pokemod", 0, "eggSpecies string", e);
+ if (const Pokemon *p = GetPokemon(e))
+ eggSpecies = p->GetId();
+}
+
+void PokeGen::PokeMod::Pokemod::SetCanHoldItems(const bool h)
+{
+ LogSetVar("Pokemod", 0, "holdItems", h);
+ holdItems = h;
+}
+
+void PokeGen::PokeMod::Pokemod::SetHasCriticalDomains(const bool c)
+{
+ LogSetVar("Pokemod", 0, "criticalDomains", c);
+ criticalDomains = c;
+}
+
+void PokeGen::PokeMod::Pokemod::SetIsContestAllowed(const bool c)
+{
+ LogSetVar("Pokemod", 0, "contestAllowed", c);
+ contestAllowed = c;
+}
+
+void PokeGen::PokeMod::Pokemod::SetIsAbilityAllowed(const bool a)
+{
+ LogSetVar("Pokemod", 0, "abilityAllowed", a);
+ abilityAllowed = a;
+}
+
+void PokeGen::PokeMod::Pokemod::SetIsNatureAllowed(const bool n)
+{
+ LogSetVar("Pokemod", 0, "natureAllowed", n);
+ natureAllowed = n;
+}
+
+void PokeGen::PokeMod::Pokemod::SetNumDaycares(const unsigned n)
+{
+ LogSetVar("Pokemod", 0, "numDaycares", n);
+ numDaycares = n;
+}
+
+void PokeGen::PokeMod::Pokemod::SetNumPokemonBoxes(const unsigned n)
+{
+ LogSetVar("Pokemod", 0, "numPokemonBoxes", n);
+ numPokemonBoxes = n;
+}
+
+void PokeGen::PokeMod::Pokemod::SetNumPokemonPerBox(const unsigned n)
+{
+ LogSetVar("Pokemod", 0, "numPokemonPerBox", n);
+ numPokemonPerBox = n;
+}
+
+void PokeGen::PokeMod::Pokemod::SetMaxParty(const unsigned m)
+{
+ LogSetVar("Pokemod", 0, "maxParty", m);
+ maxParty = m;
+}
+
+void PokeGen::PokeMod::Pokemod::SetMaxFight(const unsigned m)
+{
+ LogSetVar("Pokemod", 0, "maxFight", m);
+ if (m <= maxParty)
+ maxFight = m;
+}
+
+void PokeGen::PokeMod::Pokemod::SetMaxMoves(const unsigned m)
+{
+ LogSetVar("Pokemod", 0, "maxMoves", m);
+ maxMoves = m;
+}
+
+void PokeGen::PokeMod::Pokemod::SetMaxLevel(const unsigned m)
+{
+ LogSetVar("Pokemod", 0, "maxLevel", m);
+ maxLevel = m;
+}
+
+void PokeGen::PokeMod::Pokemod::SetMaxMoney(const unsigned m)
+{
+ LogSetVar("Pokemod", 0, "maxMoney", m);
+ maxMoney = m;
+}
+
+void PokeGen::PokeMod::Pokemod::SetIsHardCash(const bool h)
+{
+ LogSetVar("Pokemod", 0, "hardCash", h);
+ hardCash = h;
+}
+
+void PokeGen::PokeMod::Pokemod::SetIsSpecialSplit(const bool s)
+{
+ LogSetVar("Pokemod", 0, "specialSplit", s);
+ specialSplit = s;
+}
+
+void PokeGen::PokeMod::Pokemod::SetIsSpecialDVSplit(const bool s)
+{
+ LogSetVar("Pokemod", 0, "specialDVSplit", s);
+ specialDVSplit = s;
+}
+
+void PokeGen::PokeMod::Pokemod::SetMaxDVValue(const unsigned char m)
+{
+ LogSetVar("Pokemod", 0, "maxDVValue", m);
+ if ((m == 16) || (m == 32))
+ maxDVValue = m;
+}
+
+void PokeGen::PokeMod::Pokemod::SetIsHappiness(const bool h)
+{
+ LogSetVar("Pokemod", 0, "happiness", h);
+ happiness = h;
+}
+
+void PokeGen::PokeMod::Pokemod::SetHappyFaintLoss(const unsigned h)
+{
+ LogSetVar("Pokemod", 0, "happyFaintLoss", h);
+ happyFaintLoss = h;
+}
+
+void PokeGen::PokeMod::Pokemod::SetHappyLevelGain(const unsigned h)
+{
+ LogSetVar("Pokemod", 0, "happyLevelGain", h);
+ happyLevelGain = h;
+}
+
+void PokeGen::PokeMod::Pokemod::SetHappySteps(const unsigned h)
+{
+ LogSetVar("Pokemod", 0, "happySteps", h);
+ happySteps = h;
+}
+
+void PokeGen::PokeMod::Pokemod::SetIsEffortValuesAllowed(const bool e)
+{
+ LogSetVar("Pokemod", 0, "effortValuesAllowed", e);
+ effortValuesAllowed = e;
+}
+
+void PokeGen::PokeMod::Pokemod::SetMaxTotalEV(const unsigned m)
+{
+ LogSetVar("Pokemod", 0, "maxTotalEV", m);
+ maxTotalEV = m;
+}
+
+void PokeGen::PokeMod::Pokemod::SetMaxEVPerStat(const unsigned m)
+{
+ LogSetVar("Pokemod", 0, "maxEVPerStat", m);
+ maxEVPerStat = m;
+}
+
+void PokeGen::PokeMod::Pokemod::SetPokerusChance(const Frac &p)
+{
+ LogSetVar("Pokemod", 0, "pokerusChance", p.GetNum(), p.GetDenom());
+ pokerusChance = p;
+}
+
+void PokeGen::PokeMod::Pokemod::SetPokerusChance(const unsigned n, const unsigned d)
+{
+ LogSetVar("Pokemod", 0, "pokerusChance", n, d);
+ pokerusChance.Set(n, d);
+}
+
+void PokeGen::PokeMod::Pokemod::SetPokerusChanceNum(const unsigned n)
+{
+ LogSetVar("Pokemod", 0, "pokerusChance numerator", n);
+ pokerusChance.SetNum(n);
+}
+
+void PokeGen::PokeMod::Pokemod::SetPokerusChanceDenom(const unsigned d)
+{
+ LogSetVar("Pokemod", 0, "pokerusChance denominator", d);
+ pokerusChance.SetDenom(d);
+}
+
+void PokeGen::PokeMod::Pokemod::SetStartMap(const unsigned s)
+{
+ LogSetVar("Pokemod", 0, "startMap", s);
+ if (GetMap(s))
+ startMap = s;
+}
+
+void PokeGen::PokeMod::Pokemod::SetStartMap(const String &s)
+{
+ LogSetVar("Pokemod", 0, "startMap string", s);
+ if (const Map *m = GetMap(s))
+ startMap = m->GetId();
+}
+
+void PokeGen::PokeMod::Pokemod::SetStartMoney(const unsigned s)
+{
+ LogSetVar("Pokemod", 0, "startMoney", s);
+ startMoney = s;
+}
+
+void PokeGen::PokeMod::Pokemod::SetStartCoordinate(const Point &s)
+{
+ LogSetVar("Pokemod", 0, "startCoordinate", s.GetX(), s.GetY());
+ if (const Map *m = GetMap(startMap))
+ {
+ if ((s.GetX() < m->GetWidth()) && (s.GetY() < m->GetHeight()))
+ startCoordinate = s;
+ }
+}
+
+void PokeGen::PokeMod::Pokemod::SetStartCoordinate(const unsigned x, const unsigned y)
+{
+ LogSetVar("Pokemod", 0, "startCoordinate", x, y);
+ if (const Map *m = GetMap(startMap))
+ {
+ if ((x < m->GetWidth()) && (y < m->GetHeight()))
+ startCoordinate.Set(x, y);
+ }
+}
+
+void PokeGen::PokeMod::Pokemod::SetStartCoordinateX(const unsigned x)
+{
+ LogSetVar("Pokemod", 0, "startCoordinate x", x);
+ if (const Map *m = GetMap(startMap))
+ {
+ if (x < m->GetWidth())
+ startCoordinate.SetX(x);
+ }
+}
+
+void PokeGen::PokeMod::Pokemod::SetStartCoordinateY(const unsigned y)
+{
+ LogSetVar("Pokemod", 0, "startCoordinate y", y);
+ if (const Map *m = GetMap(startMap))
+ {
+ if (y < m->GetHeight())
+ startCoordinate.SetY(y);
+ }
+}
+
+void PokeGen::PokeMod::Pokemod::SetStartDirection(const unsigned s)
+{
+ LogSetVar("Pokemod", 0, "startDirection", s);
+ if (s < DIR_END)
+ startDirection = s;
+}
+
+void PokeGen::PokeMod::Pokemod::SetStartDirection(const String &s)
+{
+ SetStartDirection(FindIn(DIR_END, s, DirectionStr));
+}
+
+void PokeGen::PokeMod::Pokemod::SetStartDialog(const unsigned s)
+{
+ LogSetVar("Pokemod", 0, "startDialog", s);
+ if (GetDialog(s))
+ startDialog = s;
+}
+
+void PokeGen::PokeMod::Pokemod::SetWalkSkin(const Path &w)
+{
+ LogSetVar("Pokemod", 0, "walkSkin", w);
+ walkSkin = w;
+}
+
+void PokeGen::PokeMod::Pokemod::SetBikeSkin(const Path &b)
+{
+ LogSetVar("Pokemod", 0, "bikeSkin", b);
+ bikeSkin = b;
+}
+
+void PokeGen::PokeMod::Pokemod::SetSurfSkin(const Path &s)
+{
+ LogSetVar("Pokemod", 0, "surfSkin", s);
+ surfSkin = s;
+}
+
+void PokeGen::PokeMod::Pokemod::SetFlySkin(const Path &f)
+{
+ LogSetVar("Pokemod", 0, "flySkin", f);
+ flySkin = f;
+}
+
+void PokeGen::PokeMod::Pokemod::SetFishSkin(const Path &f)
+{
+ LogSetVar("Pokemod", 0, "fishSkin", f);
+ fishSkin = f;
+}
+
+void PokeGen::PokeMod::Pokemod::SetSurfFishSkin(const Path &s)
+{
+ LogSetVar("Pokemod", 0, "surfFishSkin", s);
+ surfFishSkin = s;
+}
+
+void PokeGen::PokeMod::Pokemod::SetSuperPCUname(const String &u)
+{
+ LogSetVar("Pokemod", 0, "superPCUname", u);
+ superPCUname = u;
+}
+
+void PokeGen::PokeMod::Pokemod::SetSuperPCPasswd(const String &p)
+{
+ LogSetVar("Pokemod", 0, "superPCPasswd", p);
+ superPCPasswd = p;
+}
+
+void PokeGen::PokeMod::Pokemod::SetStruggleMove(const unsigned s)
+{
+ LogSetVar("Pokemod", 0, "struggleMove", s);
+ if (GetMove(s))
+ struggleMove = s;
+}
+
+void PokeGen::PokeMod::Pokemod::SetStruggleMove(const String &s)
+{
+ LogSetVar("Pokemod", 0, "struggleMove string", s);
+ if (const Move *m = GetMove(s))
+ struggleMove = m->GetId();
+}
+
+void PokeGen::PokeMod::Pokemod::SetConfuseMove(const unsigned c)
+{
+ LogSetVar("Pokemod", 0, "confuseMove", c);
+ if (GetMove(c))
+ confuseMove = c;
+}
+
+void PokeGen::PokeMod::Pokemod::SetConfuseMove(const String &c)
+{
+ LogSetVar("Pokemod", 0, "confuseMove string", c);
+ if (const Move *m = GetMove(c))
+ confuseMove = m->GetId();
+}
+
+PokeGen::PokeMod::String PokeGen::PokeMod::Pokemod::GetTitle() const
+{
+ LogFetchVar("Pokemod", 0, "title", title);
+ return title;
+}
+
+PokeGen::PokeMod::String PokeGen::PokeMod::Pokemod::GetVersion() const
+{
+ LogFetchVar("Pokemod", 0, "version", version);
+ return version;
+}
+
+PokeGen::PokeMod::String PokeGen::PokeMod::Pokemod::GetDescription() const
+{
+ LogFetchVar("Pokemod", 0, "description", description);
+ return description;
+}
+
+bool PokeGen::PokeMod::Pokemod::IsGenderAllowed() const
+{
+ LogFetchVar("Pokemod", 0, "genderAllowed", genderAllowed);
+ return genderAllowed;
+}
+
+bool PokeGen::PokeMod::Pokemod::IsBreedingAllowed() const
+{
+ LogFetchVar("Pokemod", 0, "breedingAllowed", breedingAllowed);
+ return breedingAllowed;
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetEggSpecies() const
+{
+ LogFetchVar("Pokemod", 0, "eggSpecies", eggSpecies);
+ return eggSpecies;
+}
+
+PokeGen::PokeMod::String PokeGen::PokeMod::Pokemod::GetEggSpeciesString() const
+{
+ LogFetchVar("Pokemod", 0, "eggSpecies", eggSpecies);
+ if (const Pokemon *p = GetPokemon(eggSpecies))
+ return p->GetName();
+ return "";
+}
+
+bool PokeGen::PokeMod::Pokemod::CanHoldItems() const
+{
+ LogFetchVar("Pokemod", 0, "holdItems", holdItems);
+ return holdItems;
+}
+
+bool PokeGen::PokeMod::Pokemod::HasCriticalDomains() const
+{
+ LogFetchVar("Pokemod", 0, "criticalDomains", criticalDomains);
+ return criticalDomains;
+}
+
+bool PokeGen::PokeMod::Pokemod::IsContestAllowed() const
+{
+ LogFetchVar("Pokemod", 0, "contestAllowed", contestAllowed);
+ return contestAllowed;
+}
+
+bool PokeGen::PokeMod::Pokemod::IsAbilityAllowed() const
+{
+ LogFetchVar("Pokemod", 0, "abilityAllowed", abilityAllowed);
+ return abilityAllowed;
+}
+
+bool PokeGen::PokeMod::Pokemod::IsNatureAllowed() const
+{
+ LogFetchVar("Pokemod", 0, "natureAllowed", natureAllowed);
+ return natureAllowed;
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetNumDaycares() const
+{
+ LogFetchVar("Pokemod", 0, "numDaycares", numDaycares);
+ return numDaycares;
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetNumPokemonBoxes() const
+{
+ LogFetchVar("Pokemod", 0, "numPokemonBoxes", numPokemonBoxes);
+ return numPokemonBoxes;
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetNumPokemonPerBox() const
+{
+ LogFetchVar("Pokemod", 0, "numPokemonPerBox", numPokemonPerBox);
+ return numPokemonPerBox;
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetMaxParty() const
+{
+ LogFetchVar("Pokemod", 0, "maxParty", maxParty);
+ return maxParty;
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetMaxFight() const
+{
+ LogFetchVar("Pokemod", 0, "maxFight", maxFight);
+ return maxFight;
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetMaxMoves() const
+{
+ LogFetchVar("Pokemod", 0, "maxMoves", maxMoves);
+ return maxMoves;
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetMaxLevel() const
+{
+ LogFetchVar("Pokemod", 0, "maxLevel", maxLevel);
+ return maxLevel;
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetMaxMoney() const
+{
+ LogFetchVar("Pokemod", 0, "maxMoney", maxMoney);
+ return maxMoney;
+}
+
+bool PokeGen::PokeMod::Pokemod::IsHardCash() const
+{
+ LogFetchVar("Pokemod", 0, "hardCash", hardCash);
+ return hardCash;
+}
+
+bool PokeGen::PokeMod::Pokemod::IsSpecialSplit() const
+{
+ LogFetchVar("Pokemod", 0, "specialSplit", specialSplit);
+ return specialSplit;
+}
+
+bool PokeGen::PokeMod::Pokemod::IsSpecialDVSplit() const
+{
+ LogFetchVar("Pokemod", 0, "specialDVSplit", specialDVSplit);
+ return specialDVSplit;
+}
+
+unsigned char PokeGen::PokeMod::Pokemod::GetMaxDVValue() const
+{
+ LogFetchVar("Pokemod", 0, "maxDVValue", maxDVValue);
+ return maxDVValue;
+}
+
+bool PokeGen::PokeMod::Pokemod::IsHappiness() const
+{
+ LogFetchVar("Pokemod", 0, "happiness", happiness);
+ return happiness;
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetHappyFaintLoss() const
+{
+ LogFetchVar("Pokemod", 0, "happyFaintLoss", happyFaintLoss);
+ return happyFaintLoss;
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetHappyLevelGain() const
+{
+ LogFetchVar("Pokemod", 0, "happyLevelGain", happyLevelGain);
+ return happyLevelGain;
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetHappySteps() const
+{
+ LogFetchVar("Pokemod", 0, "happySteps", happySteps);
+ return happySteps;
+}
+
+bool PokeGen::PokeMod::Pokemod::IsEffortValuesAllowed() const
+{
+ LogFetchVar("Pokemod", 0, "effortValuesAllowed", effortValuesAllowed);
+ return effortValuesAllowed;
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetMaxTotalEV() const
+{
+ LogFetchVar("Pokemod", 0, "maxTotalEV", maxTotalEV);
+ return maxTotalEV;
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetMaxEVPerStat() const
+{
+ LogFetchVar("Pokemod", 0, "maxEVPerStat", maxEVPerStat);
+ return maxEVPerStat;
+}
+
+PokeGen::PokeMod::Frac PokeGen::PokeMod::Pokemod::GetPokerusChance() const
+{
+ LogFetchVar("Pokemod", 0, "pokerusChance", pokerusChance.GetNum(), pokerusChance.GetDenom());
+ return pokerusChance;
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetPokerusChanceNum() const
+{
+ LogFetchVar("Pokemod", 0, "pokerusChance numerator", pokerusChance.GetNum());
+ return pokerusChance.GetNum();
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetPokerusChanceDenom() const
+{
+ LogFetchVar("Pokemod", 0, "pokerusChance denominator", pokerusChance.GetDenom());
+ return pokerusChance.GetDenom();
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetStartMap() const
+{
+ LogFetchVar("Pokemod", 0, "startMap", startMap);
+ return startMap;
+}
+
+PokeGen::PokeMod::String PokeGen::PokeMod::Pokemod::GetStartMapString() const
+{
+ LogFetchVar("Pokemod", 0, "startMap string", startMap);
+ if (const Map *m = GetMap(startMap))
+ return m->GetName();
+ return "";
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetStartMoney() const
+{
+ LogFetchVar("Pokemod", 0, "startMoney", startMoney);
+ return startMoney;
+}
+
+PokeGen::PokeMod::Point PokeGen::PokeMod::Pokemod::GetStartCoordinate() const
+{
+ LogFetchVar("Pokemod", 0, "startCoordinate", startCoordinate.GetX(), startCoordinate.GetY());
+ return startCoordinate;
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetStartCoordinateX() const
+{
+ LogFetchVar("Pokemod", 0, "startCoordinate x", startCoordinate.GetX());
+ return startCoordinate.GetX();
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetStartCoordinateY() const
+{
+ LogFetchVar("Pokemod", 0, "startCoordinate y", startCoordinate.GetY());
+ return startCoordinate.GetY();
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetStartDirection() const
+{
+ LogFetchVar("Pokemod", 0, "startDirection", startDirection);
+ return startDirection;
+}
+
+PokeGen::PokeMod::String PokeGen::PokeMod::Pokemod::GetStartDirectionString() const
+{
+ LogFetchVar("Pokemod", 0, "startDirection string", startDirection);
+ if (startDirection < DIR_END)
+ return DirectionStr[startDirection];
+ return "";
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetStartDialog() const
+{
+ LogFetchVar("Pokemod", 0, "startDialog", startDialog);
+ return startDialog;
+}
+
+PokeGen::PokeMod::String PokeGen::PokeMod::Pokemod::GetStartDialogString() const
+{
+ LogFetchVar("Pokemod", 0, "startDialog string", startDialog);
+ if (const Dialog *d = GetDialog(startDialog))
+ return d->GetDialog();
+ return "";
+}
+
+PokeGen::PokeMod::Path PokeGen::PokeMod::Pokemod::GetWalkSkin() const
+{
+ LogFetchVar("Pokemod", 0, "walkSkin", walkSkin);
+ return walkSkin;
+}
+
+PokeGen::PokeMod::Path PokeGen::PokeMod::Pokemod::GetBikeSkin() const
+{
+ LogFetchVar("Pokemod", 0, "bikeSkin", bikeSkin);
+ return bikeSkin;
+}
+
+PokeGen::PokeMod::Path PokeGen::PokeMod::Pokemod::GetSurfSkin() const
+{
+ LogFetchVar("Pokemod", 0, "surfSkin", surfSkin);
+ return surfSkin;
+}
+
+PokeGen::PokeMod::Path PokeGen::PokeMod::Pokemod::GetFlySkin() const
+{
+ LogFetchVar("Pokemod", 0, "flySkin", flySkin);
+ return flySkin;
+}
+
+PokeGen::PokeMod::Path PokeGen::PokeMod::Pokemod::GetFishSkin() const
+{
+ LogFetchVar("Pokemod", 0, "fishSkin", fishSkin);
+ return fishSkin;
+}
+
+PokeGen::PokeMod::Path PokeGen::PokeMod::Pokemod::GetSurfFishSkin() const
+{
+ LogFetchVar("Pokemod", 0, "surfFishSkin", surfFishSkin);
+ return surfFishSkin;
+}
+
+PokeGen::PokeMod::String PokeGen::PokeMod::Pokemod::GetSuperPCUname() const
+{
+ LogFetchVar("Pokemod", 0, "superPCUname", superPCUname);
+ return superPCUname;
+}
+
+PokeGen::PokeMod::String PokeGen::PokeMod::Pokemod::GetSuperPCPasswd() const
+{
+ LogFetchVar("Pokemod", 0, "superPCPasswd", superPCPasswd);
+ return superPCPasswd;
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetStruggleMove() const
+{
+ LogFetchVar("Pokemod", 0, "struggleMove", struggleMove);
+ return struggleMove;
+}
+
+PokeGen::PokeMod::String PokeGen::PokeMod::Pokemod::GetStruggleMoveString() const
+{
+ LogFetchVar("Pokemod", 0, "struggleMove string", struggleMove);
+ if (const Move *m = GetMove(struggleMove))
+ return m->GetName();
+ return "";
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetConfuseMove() const
+{
+ LogFetchVar("Pokemod", 0, "confuseMove", confuseMove);
+ return confuseMove;
+}
+
+PokeGen::PokeMod::String PokeGen::PokeMod::Pokemod::GetConfuseMoveString() const
+{
+ LogFetchVar("Pokemod", 0, "confuseMove string", confuseMove);
+ if (const Move *m = GetMove(confuseMove))
+ return m->GetName();
+ return "";
+}
+
+void PokeGen::PokeMod::Pokemod::SetTypeChart(const unsigned att, const unsigned def, const Frac &m) const
+{
+ unsigned col = UINT_MAX;
+ unsigned row = UINT_MAX;
+ for (unsigned i = 1; (i < typeChart.GetWidth()) && ((col == UINT_MAX) || (row != UINT_MAX)); ++i)
+ {
+ if (typeChart[i][0].GetNum() == att)
+ row = i;
+ if (typeChart[i][0].GetNum() == def)
+ col = i;
+ }
+ if ((col != UINT_MAX) && (row != UINT_MAX))
+ typeChart[col][row] = m;
+}
+
+void PokeGen::PokeMod::Pokemod::SetTypeChart(const unsigned att, const unsigned def, const unsigned n, const unsigned d) const
+{
+ unsigned col = UINT_MAX;
+ unsigned row = UINT_MAX;
+ for (unsigned i = 1; (i < typeChart.GetWidth()) && ((col == UINT_MAX) || (row != UINT_MAX)); ++i)
+ {
+ if (typeChart[i][0].GetNum() == att)
+ row = i;
+ if (typeChart[i][0].GetNum() == def)
+ col = i;
+ }
+ if ((col != UINT_MAX) && (row != UINT_MAX))
+ typeChart[col][row].Set(n, d);
+}
+
+void PokeGen::PokeMod::Pokemod::SetTypeChartNum(const unsigned att, const unsigned def, const unsigned n) const
+{
+ unsigned col = UINT_MAX;
+ unsigned row = UINT_MAX;
+ for (unsigned i = 1; (i < typeChart.GetWidth()) && ((col == UINT_MAX) || (row != UINT_MAX)); ++i)
+ {
+ if (typeChart[i][0].GetNum() == att)
+ row = i;
+ if (typeChart[i][0].GetNum() == def)
+ col = i;
+ }
+ if ((col != UINT_MAX) && (row != UINT_MAX))
+ typeChart[col][row].SetNum(n);
+}
+
+void PokeGen::PokeMod::Pokemod::SetTypeChartDenom(const unsigned att, const unsigned def, const unsigned d) const
+{
+ unsigned col = UINT_MAX;
+ unsigned row = UINT_MAX;
+ for (unsigned i = 1; (i < typeChart.GetWidth()) && ((col == UINT_MAX) || (row != UINT_MAX)); ++i)
+ {
+ if (typeChart[i][0].GetNum() == att)
+ row = i;
+ if (typeChart[i][0].GetNum() == def)
+ col = i;
+ }
+ if ((col != UINT_MAX) && (row != UINT_MAX))
+ typeChart[col][row].SetDenom(d);
+}
+
+void PokeGen::PokeMod::Pokemod::SetTypeChart(const String &att, const unsigned def, const Frac &m) const
+{
+ if (const Type *t = GetType(att))
+ SetTypeChart(t->GetId(), def, m);
+}
+
+void PokeGen::PokeMod::Pokemod::SetTypeChart(const String &att, const unsigned def, const unsigned n, const unsigned d) const
+{
+ if (const Type *t = GetType(att))
+ SetTypeChart(t->GetId(), def, n, d);
+}
+
+void PokeGen::PokeMod::Pokemod::SetTypeChartNum(const String &att, const unsigned def, const unsigned n) const
+{
+ if (const Type *t = GetType(att))
+ SetTypeChartNum(t->GetId(), def, n);
+}
+
+void PokeGen::PokeMod::Pokemod::SetTypeChartDenom(const String &att, const unsigned def, const unsigned d) const
+{
+ if (const Type *t = GetType(att))
+ SetTypeChartDenom(t->GetId(), def, d);
+}
+
+void PokeGen::PokeMod::Pokemod::SetTypeChart(const unsigned att, const String &def, const Frac &m) const
+{
+ if (const Type *t = GetType(def))
+ SetTypeChart(att, t->GetId(), m);
+}
+
+void PokeGen::PokeMod::Pokemod::SetTypeChart(const unsigned att, const String &def, const unsigned n, const unsigned d) const
+{
+ if (const Type *t = GetType(def))
+ SetTypeChart(att, t->GetId(), n, d);
+}
+
+void PokeGen::PokeMod::Pokemod::SetTypeChartNum(const unsigned att, const String &def, const unsigned n) const
+{
+ if (const Type *t = GetType(def))
+ SetTypeChartNum(att, t->GetId(), n);
+}
+
+void PokeGen::PokeMod::Pokemod::SetTypeChartDenom(const unsigned att, const String &def, const unsigned d) const
+{
+ if (const Type *t = GetType(def))
+ SetTypeChartDenom(att, t->GetId(), d);
+}
+
+void PokeGen::PokeMod::Pokemod::SetTypeChart(const String &att, const String &def, const Frac &m) const
+{
+ if (const Type *t = GetType(att))
+ {
+ if (const Type *t2 = GetType(def))
+ SetTypeChart(t->GetId(), t2->GetId(), m);
+ }
+}
+
+void PokeGen::PokeMod::Pokemod::SetTypeChart(const String &att, const String &def, const unsigned n, const unsigned d) const
+{
+ if (const Type *t = GetType(att))
+ {
+ if (const Type *t2 = GetType(def))
+ SetTypeChart(t->GetId(), t2->GetId(), n, d);
+ }
+}
+
+void PokeGen::PokeMod::Pokemod::SetTypeChartNum(const String &att, const String &def, const unsigned n) const
+{
+ if (const Type *t = GetType(att))
+ {
+ if (const Type *t2 = GetType(def))
+ SetTypeChartNum(t->GetId(), t2->GetId(), n);
+ }
+}
+
+void PokeGen::PokeMod::Pokemod::SetTypeChartDenom(const String &att, const String &def, const unsigned d) const
+{
+ if (const Type *t = GetType(att))
+ {
+ if (const Type *t2 = GetType(def))
+ SetTypeChartDenom(t->GetId(), t2->GetId(), d);
+ }
+}
+
+PokeGen::PokeMod::Frac PokeGen::PokeMod::Pokemod::GetTypeChart(const unsigned att, const unsigned def) const
+{
+ unsigned col = UINT_MAX;
+ unsigned row = UINT_MAX;
+ for (unsigned i = 1; (i < typeChart.GetWidth()) && ((col == UINT_MAX) || (row != UINT_MAX)); ++i)
+ {
+ if (typeChart[i][0].GetNum() == att)
+ row = i;
+ if (typeChart[i][0].GetNum() == def)
+ col = i;
+ }
+ if ((col != UINT_MAX) && (row != UINT_MAX))
+ return typeChart[col][row];
+ return Frac(1, 1);
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetTypeChartNum(const unsigned att, const unsigned def) const
+{
+ unsigned col = UINT_MAX;
+ unsigned row = UINT_MAX;
+ for (unsigned i = 1; (i < typeChart.GetWidth()) && ((col == UINT_MAX) || (row != UINT_MAX)); ++i)
+ {
+ if (typeChart[i][0].GetNum() == att)
+ row = i;
+ if (typeChart[i][0].GetNum() == def)
+ col = i;
+ }
+ if ((col != UINT_MAX) && (row != UINT_MAX))
+ return typeChart[col][row].GetNum();
+ return UINT_MAX;
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetTypeChartDenom(const unsigned att, const unsigned def) const
+{
+ unsigned col = UINT_MAX;
+ unsigned row = UINT_MAX;
+ for (unsigned i = 1; (i < typeChart.GetWidth()) && ((col == UINT_MAX) || (row != UINT_MAX)); ++i)
+ {
+ if (typeChart[i][0].GetNum() == att)
+ row = i;
+ if (typeChart[i][0].GetNum() == def)
+ col = i;
+ }
+ if ((col != UINT_MAX) && (row != UINT_MAX))
+ return typeChart[col][row].GetDenom();
+ return UINT_MAX;
+}
+
+PokeGen::PokeMod::Frac PokeGen::PokeMod::Pokemod::GetTypeChart(const String &att, const unsigned def) const
+{
+ if (const Type *t = GetType(att))
+ return GetTypeChart(t->GetId(), def);
+ return Frac(1, 1);
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetTypeChartNum(const String &att, const unsigned def) const
+{
+ if (const Type *t = GetType(att))
+ return GetTypeChartNum(t->GetId(), def);
+ return UINT_MAX;
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetTypeChartDenom(const String &att, const unsigned def) const
+{
+ if (const Type *t = GetType(att))
+ return GetTypeChartDenom(t->GetId(), def);
+ return UINT_MAX;
+}
+
+PokeGen::PokeMod::Frac PokeGen::PokeMod::Pokemod::GetTypeChart(const unsigned att, const String &def) const
+{
+ if (const Type *t = GetType(def))
+ return GetTypeChart(att, t->GetId());
+ return Frac(1, 1);
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetTypeChartNum(const unsigned att, const String &def) const
+{
+ if (const Type *t = GetType(def))
+ return GetTypeChartNum(att, t->GetId());
+ return UINT_MAX;
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetTypeChartDenom(const unsigned att, const String &def) const
+{
+ if (const Type *t = GetType(def))
+ return GetTypeChartDenom(def, t->GetId());
+ return UINT_MAX;
+}
+
+PokeGen::PokeMod::Frac PokeGen::PokeMod::Pokemod::GetTypeChart(const String &att, const String &def) const
+{
+ if (const Type *t = GetType(att))
+ {
+ if (const Type *t2 = GetType(def))
+ return GetTypeChart(t->GetId(), t2->GetId());
+ }
+ return Frac(1, 1);
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetTypeChartNum(const String &att, const String &def) const
+{
+ if (const Type *t = GetType(att))
+ {
+ if (const Type *t2 = GetType(def))
+ return GetTypeChartNum(t->GetId(), t2->GetId());
+ }
+ return UINT_MAX;
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetTypeChartDenom(const String &att, const String &def) const
+{
+ if (const Type *t = GetType(att))
+ {
+ if (const Type *t2 = GetType(def))
+ return GetTypeChartDenom(t->GetId(), t2->GetId());
+ }
+ return UINT_MAX;
+}
+
+const PokeGen::PokeMod::Ability *PokeGen::PokeMod::Pokemod::GetAbility(const unsigned _id) const
+{
+ LogSubmoduleFetch("Pokemod", id, "ability", _id);
+ for (unsigned i = 0; i < GetAbilityCount(); ++i)
+ {
+ if (abilities[i].GetId() == _id)
+ return &abilities[i];
+ }
+ LogSubmoduleFetchFail("Pokemod", id, "ability", _id);
+ return NULL;
+}
+
+const PokeGen::PokeMod::Ability *PokeGen::PokeMod::Pokemod::GetAbility(const String &n) const
+{
+ LogSubmoduleFetch("Pokemod", id, "ability", n);
+ for (unsigned i = 0; i < GetAbilityCount(); ++i)
+ {
+ if (abilities[i].GetName() == n)
+ return &abilities[i];
+ }
+ LogSubmoduleFetchFail("Pokemod", id, "ability", n);
+ return NULL;
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetAbilityCount() const
+{
+ LogSubmoduleCount("Pokemod", id, "ability");
+ return abilities.size();
+}
+
+void PokeGen::PokeMod::Pokemod::NewAbility(Ini *const ini)
+{
+ unsigned i = 0;
+ for (; i < GetAbilityCount(); ++i)
+ {
+ if (!GetAbility(i))
+ break;
+ }
+ Ability newAbility(i);
+ if (ini)
+ newAbility.ImportIni(*ini);
+ LogSubmoduleNew("Pokemod", id, "ability", i);
+ abilities.push_back(newAbility);
+}
+
+void PokeGen::PokeMod::Pokemod::DeleteAbility(const unsigned _id)
+{
+ LogSubmoduleRemoveStart("Pokemod", id, "ability", _id);
+ for (std::vector<Ability>::iterator i = abilities.begin(); i != abilities.end(); ++i)
+ {
+ if (i->GetId() == _id)
+ {
+ LogSubmoduleRemoved("Pokemod", id, "ability", _id);
+ abilities.erase(i);
+ }
+ }
+ LogSubmoduleRemoveFail("Pokemod", id, "ability", _id);
+}
+
+void PokeGen::PokeMod::Pokemod::DeleteAbility(const String &n)
+{
+ LogSubmoduleRemoveStart("Pokemod", id, "ability", n);
+ for (std::vector<Ability>::iterator i = abilities.begin(); i != abilities.end(); ++i)
+ {
+ if (i->GetName() == n)
+ {
+ LogSubmoduleRemoved("Pokemod", id, "ability", n);
+ abilities.erase(i);
+ }
+ }
+ LogSubmoduleRemoveFail("Pokemod", id, "ability", n);
+}
+
+const PokeGen::PokeMod::Author *PokeGen::PokeMod::Pokemod::GetAuthor(const unsigned _id) const
+{
+ LogSubmoduleFetch("Pokemod", id, "author", _id);
+ for (unsigned i = 0; i < GetAuthorCount(); ++i)
+ {
+ if (authors[i].GetId() == _id)
+ return &authors[i];
+ }
+ LogSubmoduleFetchFail("Pokemod", id, "author", _id);
+ return NULL;
+}
+
+const PokeGen::PokeMod::Author *PokeGen::PokeMod::Pokemod::GetAuthor(const String &n) const
+{
+ LogSubmoduleFetch("Pokemod", id, "author", n);
+ for (unsigned i = 0; i < GetAuthorCount(); ++i)
+ {
+ if (authors[i].GetName() == n)
+ return &authors[i];
+ }
+ LogSubmoduleFetchFail("Pokemod", id, "author", n);
+ return NULL;
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetAuthorCount() const
+{
+ LogSubmoduleCount("Pokemod", id, "author");
+ return authors.size();
+}
+
+void PokeGen::PokeMod::Pokemod::NewAuthor(Ini *const ini)
+{
+ unsigned i = 0;
+ for (; i < GetAuthorCount(); ++i)
+ {
+ if (!GetAuthor(i))
+ break;
+ }
+ Author newAuthor(i);
+ if (ini)
+ newAuthor.ImportIni(*ini);
+ LogSubmoduleNew("Pokemod", id, "author", i);
+ authors.push_back(newAuthor);
+}
+
+void PokeGen::PokeMod::Pokemod::DeleteAuthor(const unsigned _id)
+{
+ LogSubmoduleRemoveStart("Pokemod", id, "author", _id);
+ for (std::vector<Author>::iterator i = authors.begin(); i != authors.end(); ++i)
+ {
+ if (i->GetId() == _id)
+ {
+ LogSubmoduleRemoved("Pokemod", id, "author", _id);
+ authors.erase(i);
+ }
+ }
+ LogSubmoduleRemoveFail("Pokemod", id, "author", _id);
+}
+
+void PokeGen::PokeMod::Pokemod::DeleteAuthor(const String &n)
+{
+ LogSubmoduleRemoveStart("Pokemod", id, "author", n);
+ for (std::vector<Author>::iterator i = authors.begin(); i != authors.end(); ++i)
+ {
+ if (i->GetName() == n)
+ {
+ LogSubmoduleRemoved("Pokemod", id, "author", n);
+ authors.erase(i);
+ }
+ }
+ LogSubmoduleRemoveFail("Pokemod", id, "author", n);
+}
+
+const PokeGen::PokeMod::Badge *PokeGen::PokeMod::Pokemod::GetBadge(const unsigned _id) const
+{
+ LogSubmoduleFetch("Pokemod", id, "badge", _id);
+ for (unsigned i = 0; i < GetBadgeCount(); ++i)
+ {
+ if (badges[i].GetId() == _id)
+ return &badges[i];
+ }
+ LogSubmoduleFetchFail("Pokemod", id, "badge", _id);
+ return NULL;
+}
+
+const PokeGen::PokeMod::Badge *PokeGen::PokeMod::Pokemod::GetBadge(const String &n) const
+{
+ LogSubmoduleFetch("Pokemod", id, "badge", n);
+ for (unsigned i = 0; i < GetBadgeCount(); ++i)
+ {
+ if (badges[i].GetName() == n)
+ return &badges[i];
+ }
+ LogSubmoduleFetchFail("Pokemod", id, "badge", n);
+ return NULL;
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetBadgeCount() const
+{
+ LogSubmoduleCount("Pokemod", id, "badge");
+ return badges.size();
+}
+
+void PokeGen::PokeMod::Pokemod::NewBadge(Ini *const ini)
+{
+ unsigned i = 0;
+ for (; i < GetBadgeCount(); ++i)
+ {
+ if (!GetBadge(i))
+ break;
+ }
+ Badge newBadge(i);
+ if (ini)
+ newBadge.ImportIni(*ini);
+ LogSubmoduleNew("Pokemod", id, "badge", i);
+ badges.push_back(newBadge);
+}
+
+void PokeGen::PokeMod::Pokemod::DeleteBadge(const unsigned _id)
+{
+ LogSubmoduleRemoveStart("Pokemod", id, "badge", _id);
+ for (std::vector<Badge>::iterator i = badges.begin(); i != badges.end(); ++i)
+ {
+ if (i->GetId() == _id)
+ {
+ LogSubmoduleRemoved("Pokemod", id, "badge", _id);
+ badges.erase(i);
+ }
+ }
+ LogSubmoduleRemoveFail("Pokemod", id, "badge", _id);
+}
+
+void PokeGen::PokeMod::Pokemod::DeleteBadge(const String &n)
+{
+ LogSubmoduleRemoveStart("Pokemod", id, "badge", n);
+ for (std::vector<Badge>::iterator i = badges.begin(); i != badges.end(); ++i)
+ {
+ if (i->GetName() == n)
+ {
+ LogSubmoduleRemoved("Pokemod", id, "badge", n);
+ badges.erase(i);
+ }
+ }
+ LogSubmoduleRemoveFail("Pokemod", id, "badge", n);
+}
+
+const PokeGen::PokeMod::CoinList *PokeGen::PokeMod::Pokemod::GetCoinList(const unsigned _id) const
+{
+ LogSubmoduleFetch("Pokemod", id, "coin list", _id);
+ for (unsigned i = 0; i < GetCoinListCount(); ++i)
+ {
+ if (coinLists[i].GetId() == _id)
+ return &coinLists[i];
+ }
+ LogSubmoduleFetchFail("Pokemod", id, "coin list", _id);
+ return NULL;
+}
+
+const PokeGen::PokeMod::CoinList *PokeGen::PokeMod::Pokemod::GetCoinList(const String &n) const
+{
+ LogSubmoduleFetch("Pokemod", id, "coin list", n);
+ for (unsigned i = 0; i < GetCoinListCount(); ++i)
+ {
+ if (coinLists[i].GetName() == n)
+ return &coinLists[i];
+ }
+ LogSubmoduleFetchFail("Pokemod", id, "coin list", n);
+ return NULL;
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetCoinListCount() const
+{
+ LogSubmoduleCount("Pokemod", id, "coin list");
+ return coinLists.size();
+}
+
+void PokeGen::PokeMod::Pokemod::NewCoinList(Ini *const ini)
+{
+ unsigned i = 0;
+ for (; i < GetCoinListCount(); ++i)
+ {
+ if (!GetCoinList(i))
+ break;
+ }
+ CoinList newCoinList(i);
+ if (ini)
+ newCoinList.ImportIni(*ini);
+ LogSubmoduleNew("Pokemod", id, "coin list", i);
+ coinLists.push_back(newCoinList);
+}
+
+void PokeGen::PokeMod::Pokemod::DeleteCoinList(const unsigned _id)
+{
+ LogSubmoduleRemoveStart("Pokemod", id, "coin list", _id);
+ for (std::vector<CoinList>::iterator i = coinLists.begin(); i != coinLists.end(); ++i)
+ {
+ if (i->GetId() == _id)
+ {
+ LogSubmoduleRemoved("Pokemod", id, "coin list", _id);
+ coinLists.erase(i);
+ }
+ }
+ LogSubmoduleRemoveFail("Pokemod", id, "coin list", _id);
+}
+
+void PokeGen::PokeMod::Pokemod::DeleteCoinList(const String &n)
+{
+ LogSubmoduleRemoveStart("Pokemod", id, "coin list", n);
+ for (std::vector<CoinList>::iterator i = coinLists.begin(); i != coinLists.end(); ++i)
+ {
+ if (i->GetName() == n)
+ {
+ LogSubmoduleRemoved("Pokemod", id, "coin list", n);
+ coinLists.erase(i);
+ }
+ }
+ LogSubmoduleRemoveFail("Pokemod", id, "coin list", n);
+}
+
+const PokeGen::PokeMod::Dialog *PokeGen::PokeMod::Pokemod::GetDialog(const unsigned _id) const
+{
+ LogSubmoduleFetch("Pokemod", id, "dialog", _id);
+ for (unsigned i = 0; i < GetDialogCount(); ++i)
+ {
+ if (dialogs[i].GetId() == _id)
+ return &dialogs[i];
+ }
+ LogSubmoduleFetchFail("Pokemod", id, "dialog", _id);
+ return NULL;
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetDialogCount() const
+{
+ LogSubmoduleCount("Pokemod", id, "dialog");
+ return dialogs.size();
+}
+
+void PokeGen::PokeMod::Pokemod::NewDialog(Ini *const ini)
+{
+ unsigned i = 0;
+ for (; i < GetDialogCount(); ++i)
+ {
+ if (!GetDialog(i))
+ break;
+ }
+ Dialog newDialog(i);
+ if (ini)
+ newDialog.ImportIni(*ini);
+ LogSubmoduleNew("Pokemod", id, "dialog", i);
+ dialogs.push_back(newDialog);
+}
+
+void PokeGen::PokeMod::Pokemod::DeleteDialog(const unsigned _id)
+{
+ LogSubmoduleRemoveStart("Pokemod", id, "dialog", _id);
+ for (std::vector<Dialog>::iterator i = dialogs.begin(); i != dialogs.end(); ++i)
+ {
+ if (i->GetId() == _id)
+ {
+ LogSubmoduleRemoved("Pokemod", id, "dialog", _id);
+ dialogs.erase(i);
+ }
+ }
+ LogSubmoduleRemoveFail("Pokemod", id, "dialog", _id);
+}
+
+const PokeGen::PokeMod::EggGroup *PokeGen::PokeMod::Pokemod::GetEggGroup(const unsigned _id) const
+{
+ LogSubmoduleFetch("Pokemod", id, "egg group", _id);
+ for (unsigned i = 0; i < GetEggGroupCount(); ++i)
+ {
+ if (eggGroups[i].GetId() == _id)
+ return &eggGroups[i];
+ }
+ LogSubmoduleFetchFail("Pokemod", id, "egg group", _id);
+ return NULL;
+}
+
+const PokeGen::PokeMod::EggGroup *PokeGen::PokeMod::Pokemod::GetEggGroup(const String &n) const
+{
+ LogSubmoduleFetch("Pokemod", id, "egg group", n);
+ for (unsigned i = 0; i < GetEggGroupCount(); ++i)
+ {
+ if (eggGroups[i].GetName() == n)
+ return &eggGroups[i];
+ }
+ LogSubmoduleFetchFail("Pokemod", id, "egg group", n);
+ return NULL;
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetEggGroupCount() const
+{
+ LogSubmoduleCount("Pokemod", id, "egg group");
+ return eggGroups.size();
+}
+
+void PokeGen::PokeMod::Pokemod::NewEggGroup(Ini *const ini)
+{
+ unsigned i = 0;
+ for (; i < GetEggGroupCount(); ++i)
+ {
+ if (!GetEggGroup(i))
+ break;
+ }
+ EggGroup newEggGroup(i);
+ if (ini)
+ newEggGroup.ImportIni(*ini);
+ LogSubmoduleNew("Pokemod", id, "egg group", i);
+ eggGroups.push_back(newEggGroup);
+}
+
+void PokeGen::PokeMod::Pokemod::DeleteEggGroup(const unsigned _id)
+{
+ LogSubmoduleRemoveStart("Pokemod", id, "egg group", _id);
+ for (std::vector<EggGroup>::iterator i = eggGroups.begin(); i != eggGroups.end(); ++i)
+ {
+ if (i->GetId() == _id)
+ {
+ LogSubmoduleRemoved("Pokemod", id, "egg group", _id);
+ eggGroups.erase(i);
+ }
+ }
+ LogSubmoduleRemoveFail("Pokemod", id, "egg group", _id);
+}
+
+void PokeGen::PokeMod::Pokemod::DeleteEggGroup(const String &n)
+{
+ LogSubmoduleRemoveStart("Pokemod", id, "egg group", n);
+ for (std::vector<EggGroup>::iterator i = eggGroups.begin(); i != eggGroups.end(); ++i)
+ {
+ if (i->GetName() == n)
+ {
+ LogSubmoduleRemoved("Pokemod", id, "egg group", n);
+ eggGroups.erase(i);
+ }
+ }
+ LogSubmoduleRemoveFail("Pokemod", id, "egg group", n);
+}
+
+const PokeGen::PokeMod::Item *PokeGen::PokeMod::Pokemod::GetItem(const unsigned _id) const
+{
+ LogSubmoduleFetch("Pokemod", id, "item", _id);
+ for (unsigned i = 0; i < GetItemCount(); ++i)
+ {
+ if (items[i].GetId() == _id)
+ return &items[i];
+ }
+ LogSubmoduleFetchFail("Pokemod", id, "item", _id);
+ return NULL;
+}
+
+const PokeGen::PokeMod::Item *PokeGen::PokeMod::Pokemod::GetItem(const String &n) const
+{
+ LogSubmoduleFetch("Pokemod", id, "item", n);
+ for (unsigned i = 0; i < GetItemCount(); ++i)
+ {
+ if (items[i].GetName() == n)
+ return &items[i];
+ }
+ LogSubmoduleFetchFail("Pokemod", id, "item", n);
+ return NULL;
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetItemCount() const
+{
+ LogSubmoduleCount("Pokemod", id, "item");
+ return items.size();
+}
+
+void PokeGen::PokeMod::Pokemod::NewItem(Ini *const ini)
+{
+ unsigned i = 0;
+ for (; i < GetItemCount(); ++i)
+ {
+ if (!GetItem(i))
+ break;
+ }
+ Item newItem(i);
+ if (ini)
+ newItem.ImportIni(*ini);
+ LogSubmoduleNew("Pokemod", id, "item", i);
+ items.push_back(newItem);
+}
+
+void PokeGen::PokeMod::Pokemod::DeleteItem(const unsigned _id)
+{
+ LogSubmoduleRemoveStart("Pokemod", id, "item", _id);
+ for (std::vector<Item>::iterator i = items.begin(); i != items.end(); ++i)
+ {
+ if (i->GetId() == _id)
+ {
+ LogSubmoduleRemoved("Pokemod", id, "item", _id);
+ items.erase(i);
+ }
+ }
+ LogSubmoduleRemoveFail("Pokemod", id, "item", _id);
+}
+
+void PokeGen::PokeMod::Pokemod::DeleteItem(const String &n)
+{
+ LogSubmoduleRemoveStart("Pokemod", id, "item", n);
+ for (std::vector<Item>::iterator i = items.begin(); i != items.end(); ++i)
+ {
+ if (i->GetName() == n)
+ {
+ LogSubmoduleRemoved("Pokemod", id, "item", n);
+ items.erase(i);
+ }
+ }
+ LogSubmoduleRemoveFail("Pokemod", id, "item", n);
+}
+
+const PokeGen::PokeMod::ItemStorage *PokeGen::PokeMod::Pokemod::GetItemStorage(const unsigned _id) const
+{
+ LogSubmoduleFetch("Pokemod", id, "item storage", _id);
+ for (unsigned i = 0; i < GetItemStorageCount(); ++i)
+ {
+ if (itemStorages[i].GetId() == _id)
+ return &itemStorages[i];
+ }
+ LogSubmoduleFetchFail("Pokemod", id, "item storage", _id);
+ return NULL;
+}
+
+const PokeGen::PokeMod::ItemStorage *PokeGen::PokeMod::Pokemod::GetItemStorage(const String &n) const
+{
+ LogSubmoduleFetch("Pokemod", id, "item storage", n);
+ for (unsigned i = 0; i < GetItemStorageCount(); ++i)
+ {
+ if (itemStorages[i].GetName() == n)
+ return &itemStorages[i];
+ }
+ LogSubmoduleFetchFail("Pokemod", id, "item storage", n);
+ return NULL;
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetItemStorageCount() const
+{
+ LogSubmoduleCount("Pokemod", id, "item storage");
+ return itemStorages.size();
+}
+
+void PokeGen::PokeMod::Pokemod::NewItemStorage(Ini *const ini)
+{
+ unsigned i = 0;
+ for (; i < GetItemStorageCount(); ++i)
+ {
+ if (!GetItemStorage(i))
+ break;
+ }
+ ItemStorage newItemStorage(i);
+ if (ini)
+ newItemStorage.ImportIni(*ini);
+ LogSubmoduleNew("Pokemod", id, "item storage", i);
+ itemStorages.push_back(newItemStorage);
+}
+
+void PokeGen::PokeMod::Pokemod::DeleteItemStorage(const unsigned _id)
+{
+ LogSubmoduleRemoveStart("Pokemod", id, "item storage", _id);
+ for (std::vector<ItemStorage>::iterator i = itemStorages.begin(); i != itemStorages.end(); ++i)
+ {
+ if (i->GetId() == _id)
+ {
+ LogSubmoduleRemoved("Pokemod", id, "item storage", _id);
+ itemStorages.erase(i);
+ }
+ }
+ LogSubmoduleRemoveFail("Pokemod", id, "item storage", _id);
+}
+
+void PokeGen::PokeMod::Pokemod::DeleteItemStorage(const String &n)
+{
+ LogSubmoduleRemoveStart("Pokemod", id, "item storage", n);
+ for (std::vector<ItemStorage>::iterator i = itemStorages.begin(); i != itemStorages.end(); ++i)
+ {
+ if (i->GetName() == n)
+ {
+ LogSubmoduleRemoved("Pokemod", id, "item storage", n);
+ itemStorages.erase(i);
+ }
+ }
+ LogSubmoduleRemoveFail("Pokemod", id, "item storage", n);
+}
+
+const PokeGen::PokeMod::Map *PokeGen::PokeMod::Pokemod::GetMap(const unsigned _id) const
+{
+ LogSubmoduleFetch("Pokemod", id, "map", _id);
+ for (unsigned i = 0; i < GetMapCount(); ++i)
+ {
+ if (maps[i].GetId() == _id)
+ return &maps[i];
+ }
+ LogSubmoduleFetchFail("Pokemod", id, "map", _id);
+ return NULL;
+}
+
+const PokeGen::PokeMod::Map *PokeGen::PokeMod::Pokemod::GetMap(const String &n) const
+{
+ LogSubmoduleFetch("Pokemod", id, "map", n);
+ for (unsigned i = 0; i < GetMapCount(); ++i)
+ {
+ if (maps[i].GetName() == n)
+ return &maps[i];
+ }
+ LogSubmoduleFetchFail("Pokemod", id, "map", n);
+ return NULL;
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetMapCount() const
+{
+ LogSubmoduleCount("Pokemod", id, "map");
+ return maps.size();
+}
+
+void PokeGen::PokeMod::Pokemod::NewMap(Ini *const ini)
+{
+ unsigned i = 0;
+ for (; i < GetMapCount(); ++i)
+ {
+ if (!GetMap(i))
+ break;
+ }
+ Map newMap(i);
+ if (ini)
+ newMap.ImportIni(*ini);
+ LogSubmoduleNew("Pokemod", id, "map", i);
+ maps.push_back(newMap);
+}
+
+void PokeGen::PokeMod::Pokemod::DeleteMap(const unsigned _id)
+{
+ LogSubmoduleRemoveStart("Pokemod", id, "map", _id);
+ for (std::vector<Map>::iterator i = maps.begin(); i != maps.end(); ++i)
+ {
+ if (i->GetId() == _id)
+ {
+ LogSubmoduleRemoved("Pokemod", id, "map", _id);
+ maps.erase(i);
+ }
+ }
+ LogSubmoduleRemoveFail("Pokemod", id, "map", _id);
+}
+
+void PokeGen::PokeMod::Pokemod::DeleteMap(const String &n)
+{
+ LogSubmoduleRemoveStart("Pokemod", id, "map", n);
+ for (std::vector<Map>::iterator i = maps.begin(); i != maps.end(); ++i)
+ {
+ if (i->GetName() == n)
+ {
+ LogSubmoduleRemoved("Pokemod", id, "map", n);
+ maps.erase(i);
+ }
+ }
+ LogSubmoduleRemoveFail("Pokemod", id, "map", n);
+}
+
+const PokeGen::PokeMod::Move *PokeGen::PokeMod::Pokemod::GetMove(const unsigned _id) const
+{
+ LogSubmoduleFetch("Pokemod", id, "move", _id);
+ for (unsigned i = 0; i < GetMoveCount(); ++i)
+ {
+ if (moves[i].GetId() == _id)
+ return &moves[i];
+ }
+ LogSubmoduleFetchFail("Pokemod", id, "move", _id);
+ return NULL;
+}
+
+const PokeGen::PokeMod::Move *PokeGen::PokeMod::Pokemod::GetMove(const String &n) const
+{
+ LogSubmoduleFetch("Pokemod", id, "move", n);
+ for (unsigned i = 0; i < GetMoveCount(); ++i)
+ {
+ if (moves[i].GetName() == n)
+ return &moves[i];
+ }
+ LogSubmoduleFetchFail("Pokemod", id, "move", n);
+ return NULL;
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetMoveCount() const
+{
+ LogSubmoduleCount("Pokemod", id, "move");
+ return moves.size();
+}
+
+void PokeGen::PokeMod::Pokemod::NewMove(Ini *const ini)
+{
+ unsigned i = 0;
+ for (; i < GetMoveCount(); ++i)
+ {
+ if (!GetMove(i))
+ break;
+ }
+ Move newMove(i);
+ if (ini)
+ newMove.ImportIni(*ini);
+ LogSubmoduleNew("Pokemod", id, "move", i);
+ moves.push_back(newMove);
+}
+
+void PokeGen::PokeMod::Pokemod::DeleteMove(const unsigned _id)
+{
+ LogSubmoduleRemoveStart("Pokemod", id, "move", _id);
+ for (std::vector<Move>::iterator i = moves.begin(); i != moves.end(); ++i)
+ {
+ if (i->GetId() == _id)
+ {
+ LogSubmoduleRemoved("Pokemod", id, "move", _id);
+ moves.erase(i);
+ }
+ }
+ LogSubmoduleRemoveFail("Pokemod", id, "move", _id);
+}
+
+void PokeGen::PokeMod::Pokemod::DeleteMove(const String &n)
+{
+ LogSubmoduleRemoveStart("Pokemod", id, "move", n);
+ for (std::vector<Move>::iterator i = moves.begin(); i != moves.end(); ++i)
+ {
+ if (i->GetName() == n)
+ {
+ LogSubmoduleRemoved("Pokemod", id, "move", n);
+ moves.erase(i);
+ }
+ }
+ LogSubmoduleRemoveFail("Pokemod", id, "move", n);
+}
+
+const PokeGen::PokeMod::Nature *PokeGen::PokeMod::Pokemod::GetNature(const unsigned _id) const
+{
+ LogSubmoduleFetch("Pokemod", id, "nature", _id);
+ for (unsigned i = 0; i < GetNatureCount(); ++i)
+ {
+ if (natures[i].GetId() == _id)
+ return &natures[i];
+ }
+ LogSubmoduleFetchFail("Pokemod", id, "nature", _id);
+ return NULL;
+}
+
+const PokeGen::PokeMod::Nature *PokeGen::PokeMod::Pokemod::GetNature(const String &n) const
+{
+ LogSubmoduleFetch("Pokemod", id, "nature", n);
+ for (unsigned i = 0; i < GetNatureCount(); ++i)
+ {
+ if (natures[i].GetName() == n)
+ return &natures[i];
+ }
+ LogSubmoduleFetchFail("Pokemod", id, "nature", n);
+ return NULL;
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetNatureCount() const
+{
+ LogSubmoduleCount("Pokemod", id, "nature");
+ return natures.size();
+}
+
+void PokeGen::PokeMod::Pokemod::NewNature(Ini *const ini)
+{
+ unsigned i = 0;
+ for (; i < GetNatureCount(); ++i)
+ {
+ if (!GetNature(i))
+ break;
+ }
+ Nature newNature(i);
+ if (ini)
+ newNature.ImportIni(*ini);
+ LogSubmoduleNew("Pokemod", id, "nature", i);
+ natures.push_back(newNature);
+}
+
+void PokeGen::PokeMod::Pokemod::DeleteNature(const unsigned _id)
+{
+ LogSubmoduleRemoveStart("Pokemod", id, "nature", _id);
+ for (std::vector<Nature>::iterator i = natures.begin(); i != natures.end(); ++i)
+ {
+ if (i->GetId() == _id)
+ {
+ LogSubmoduleRemoved("Pokemod", id, "nature", _id);
+ natures.erase(i);
+ }
+ }
+ LogSubmoduleRemoveFail("Pokemod", id, "nature", _id);
+}
+
+void PokeGen::PokeMod::Pokemod::DeleteNature(const String &n)
+{
+ LogSubmoduleRemoveStart("Pokemod", id, "nature", n);
+ for (std::vector<Nature>::iterator i = natures.begin(); i != natures.end(); ++i)
+ {
+ if (i->GetName() == n)
+ {
+ LogSubmoduleRemoved("Pokemod", id, "nature", n);
+ natures.erase(i);
+ }
+ }
+ LogSubmoduleRemoveFail("Pokemod", id, "nature", n);
+}
+
+const PokeGen::PokeMod::Pokemon *PokeGen::PokeMod::Pokemod::GetPokemon(const unsigned _id) const
+{
+ LogSubmoduleFetch("Pokemod", id, "Pokémon", _id);
+ for (unsigned i = 0; i < GetPokemonCount(); ++i)
+ {
+ if (pokemon[i].GetId() == _id)
+ return &pokemon[i];
+ }
+ LogSubmoduleFetchFail("Pokemod", id, "Pokémon", _id);
+ return NULL;
+}
+
+const PokeGen::PokeMod::Pokemon *PokeGen::PokeMod::Pokemod::GetPokemon(const String &n) const
+{
+ LogSubmoduleFetch("Pokemod", id, "Pokémon", n);
+ for (unsigned i = 0; i < GetPokemonCount(); ++i)
+ {
+ if (pokemon[i].GetName() == n)
+ return &pokemon[i];
+ }
+ LogSubmoduleFetchFail("Pokemod", id, "Pokémon", n);
+ return NULL;
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetPokemonCount() const
+{
+ LogSubmoduleCount("Pokemod", id, "Pokémon");
+ return pokemon.size();
+}
+
+void PokeGen::PokeMod::Pokemod::NewPokemon(Ini *const ini)
+{
+ unsigned i = 0;
+ for (; i < GetPokemonCount(); ++i)
+ {
+ if (!GetPokemon(i))
+ break;
+ }
+ Pokemon newPokemon(i);
+ if (ini)
+ newPokemon.ImportIni(*ini);
+ LogSubmoduleNew("Pokemod", id, "Pokémon", i);
+ pokemon.push_back(newPokemon);
+}
+
+void PokeGen::PokeMod::Pokemod::DeletePokemon(const unsigned _id)
+{
+ LogSubmoduleRemoveStart("Pokemod", id, "Pokémon", _id);
+ for (std::vector<Pokemon>::iterator i = pokemon.begin(); i != pokemon.end(); ++i)
+ {
+ if (i->GetId() == _id)
+ {
+ LogSubmoduleRemoved("Pokemod", id, "Pokémon", _id);
+ pokemon.erase(i);
+ }
+ }
+ LogSubmoduleRemoveFail("Pokemod", id, "Pokémon", _id);
+}
+
+void PokeGen::PokeMod::Pokemod::DeletePokemon(const String &n)
+{
+ LogSubmoduleRemoveStart("Pokemod", id, "Pokémon", n);
+ for (std::vector<Pokemon>::iterator i = pokemon.begin(); i != pokemon.end(); ++i)
+ {
+ if (i->GetName() == n)
+ {
+ LogSubmoduleRemoved("Pokemod", id, "Pokémon", n);
+ pokemon.erase(i);
+ }
+ }
+ LogSubmoduleRemoveFail("Pokemod", id, "Pokémon", n);
+}
+
+const PokeGen::PokeMod::Status *PokeGen::PokeMod::Pokemod::GetStatus(const unsigned _id) const
+{
+ LogSubmoduleFetch("Pokemod", id, "status", _id);
+ for (unsigned i = 0; i < GetStatusCount(); ++i)
+ {
+ if (statuses[i].GetId() == _id)
+ return &statuses[i];
+ }
+ LogSubmoduleFetchFail("Pokemod", id, "status", _id);
+ return NULL;
+}
+
+const PokeGen::PokeMod::Status *PokeGen::PokeMod::Pokemod::GetStatus(const String &n) const
+{
+ LogSubmoduleFetch("Pokemod", id, "status", n);
+ for (unsigned i = 0; i < GetStatusCount(); ++i)
+ {
+ if (statuses[i].GetName() == n)
+ return &statuses[i];
+ }
+ LogSubmoduleFetchFail("Pokemod", id, "status", n);
+ return NULL;
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetStatusCount() const
+{
+ LogSubmoduleCount("Pokemod", id, "status");
+ return statuses.size();
+}
+
+void PokeGen::PokeMod::Pokemod::NewStatus(Ini *const ini)
+{
+ unsigned i = 0;
+ for (; i < GetStatusCount(); ++i)
+ {
+ if (!GetStatus(i))
+ break;
+ }
+ Status newStatus(i);
+ if (ini)
+ newStatus.ImportIni(*ini);
+ LogSubmoduleNew("Pokemod", id, "status", i);
+ statuses.push_back(newStatus);
+}
+
+void PokeGen::PokeMod::Pokemod::DeleteStatus(const unsigned _id)
+{
+ LogSubmoduleRemoveStart("Pokemod", id, "status", _id);
+ for (std::vector<Status>::iterator i = statuses.begin(); i != statuses.end(); ++i)
+ {
+ if (i->GetId() == _id)
+ {
+ LogSubmoduleRemoved("Pokemod", id, "status", _id);
+ statuses.erase(i);
+ }
+ }
+ LogSubmoduleRemoveFail("Pokemod", id, "status", _id);
+}
+
+void PokeGen::PokeMod::Pokemod::DeleteStatus(const String &n)
+{
+ LogSubmoduleRemoveStart("Pokemod", id, "status", n);
+ for (std::vector<Status>::iterator i = statuses.begin(); i != statuses.end(); ++i)
+ {
+ if (i->GetName() == n)
+ {
+ LogSubmoduleRemoved("Pokemod", id, "status", n);
+ statuses.erase(i);
+ }
+ }
+ LogSubmoduleRemoveFail("Pokemod", id, "status", n);
+}
+
+const PokeGen::PokeMod::Store *PokeGen::PokeMod::Pokemod::GetStore(const unsigned _id) const
+{
+ LogSubmoduleFetch("Pokemod", id, "store", _id);
+ for (unsigned i = 0; i < GetStoreCount(); ++i)
+ {
+ if (stores[i].GetId() == _id)
+ return &stores[i];
+ }
+ LogSubmoduleFetchFail("Pokemod", id, "store", _id);
+ return NULL;
+}
+
+const PokeGen::PokeMod::Store *PokeGen::PokeMod::Pokemod::GetStore(const String &n) const
+{
+ LogSubmoduleFetch("Pokemod", id, "store", n);
+ for (unsigned i = 0; i < GetStoreCount(); ++i)
+ {
+ if (stores[i].GetName() == n)
+ return &stores[i];
+ }
+ LogSubmoduleFetchFail("Pokemod", id, "store", n);
+ return NULL;
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetStoreCount() const
+{
+ LogSubmoduleCount("Pokemod", id, "store");
+ return stores.size();
+}
+
+void PokeGen::PokeMod::Pokemod::NewStore(Ini *const ini)
+{
+ unsigned i = 0;
+ for (; i < GetStoreCount(); ++i)
+ {
+ if (!GetStore(i))
+ break;
+ }
+ Store newStore(i);
+ if (ini)
+ newStore.ImportIni(*ini);
+ LogSubmoduleNew("Pokemod", id, "store", i);
+ stores.push_back(newStore);
+}
+
+void PokeGen::PokeMod::Pokemod::DeleteStore(const unsigned _id)
+{
+ LogSubmoduleRemoveStart("Pokemod", id, "store", _id);
+ for (std::vector<Store>::iterator i = stores.begin(); i != stores.end(); ++i)
+ {
+ if (i->GetId() == _id)
+ {
+ LogSubmoduleRemoved("Pokemod", id, "store", _id);
+ stores.erase(i);
+ }
+ }
+ LogSubmoduleRemoveFail("Pokemod", id, "store", _id);
+}
+
+void PokeGen::PokeMod::Pokemod::DeleteStore(const String &n)
+{
+ LogSubmoduleRemoveStart("Pokemod", id, "store", n);
+ for (std::vector<Store>::iterator i = stores.begin(); i != stores.end(); ++i)
+ {
+ if (i->GetName() == n)
+ {
+ LogSubmoduleRemoved("Pokemod", id, "store", n);
+ stores.erase(i);
+ }
+ }
+ LogSubmoduleRemoveFail("Pokemod", id, "store", n);
+}
+
+const PokeGen::PokeMod::Tile *PokeGen::PokeMod::Pokemod::GetTile(const unsigned _id) const
+{
+ LogSubmoduleFetch("Pokemod", id, "tile", _id);
+ for (unsigned i = 0; i < GetTileCount(); ++i)
+ {
+ if (tiles[i].GetId() == _id)
+ return &tiles[i];
+ }
+ LogSubmoduleFetchFail("Pokemod", id, "tile", _id);
+ return NULL;
+}
+
+const PokeGen::PokeMod::Tile *PokeGen::PokeMod::Pokemod::GetTile(const String &n) const
+{
+ LogSubmoduleFetch("Pokemod", id, "tile", n);
+ for (unsigned i = 0; i < GetTileCount(); ++i)
+ {
+ if (tiles[i].GetName() == n)
+ return &tiles[i];
+ }
+ LogSubmoduleFetchFail("Pokemod", id, "tile", n);
+ return NULL;
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetTileCount() const
+{
+ LogSubmoduleCount("Pokemod", id, "tile");
+ return tiles.size();
+}
+
+void PokeGen::PokeMod::Pokemod::NewTile(Ini *const ini)
+{
+ unsigned i = 0;
+ for (; i < GetTileCount(); ++i)
+ {
+ if (!GetTile(i))
+ break;
+ }
+ Tile newTile(i);
+ if (ini)
+ newTile.ImportIni(*ini);
+ LogSubmoduleNew("Pokemod", id, "tile", i);
+ tiles.push_back(newTile);
+}
+
+void PokeGen::PokeMod::Pokemod::DeleteTile(const unsigned _id)
+{
+ LogSubmoduleRemoveStart("Pokemod", id, "tile", _id);
+ for (std::vector<Tile>::iterator i = tiles.begin(); i != tiles.end(); ++i)
+ {
+ if (i->GetId() == _id)
+ {
+ LogSubmoduleRemoved("Pokemod", id, "tile", _id);
+ tiles.erase(i);
+ }
+ }
+ LogSubmoduleRemoveFail("Pokemod", id, "tile", _id);
+}
+
+void PokeGen::PokeMod::Pokemod::DeleteTile(const String &n)
+{
+ LogSubmoduleRemoveStart("Pokemod", id, "tile", n);
+ for (std::vector<Tile>::iterator i = tiles.begin(); i != tiles.end(); ++i)
+ {
+ if (i->GetName() == n)
+ {
+ LogSubmoduleRemoved("Pokemod", id, "tile", n);
+ tiles.erase(i);
+ }
+ }
+ LogSubmoduleRemoveFail("Pokemod", id, "tile", n);
+}
+
+const PokeGen::PokeMod::Time *PokeGen::PokeMod::Pokemod::GetTime(const unsigned _id) const
+{
+ LogSubmoduleFetch("Pokemod", id, "time", _id);
+ for (unsigned i = 0; i < GetTimeCount(); ++i)
+ {
+ if (times[i].GetId() == _id)
+ return ×[i];
+ }
+ LogSubmoduleFetchFail("Pokemod", id, "time", _id);
+ return NULL;
+}
+
+const PokeGen::PokeMod::Time *PokeGen::PokeMod::Pokemod::GetTime(const String &n) const
+{
+ LogSubmoduleFetch("Pokemod", id, "time", n);
+ for (unsigned i = 0; i < GetTimeCount(); ++i)
+ {
+ if (times[i].GetName() == n)
+ return ×[i];
+ }
+ LogSubmoduleFetchFail("Pokemod", id, "time", n);
+ return NULL;
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetTimeCount() const
+{
+ LogSubmoduleCount("Pokemod", id, "time");
+ return times.size();
+}
+
+void PokeGen::PokeMod::Pokemod::NewTime(Ini *const ini)
+{
+ unsigned i = 0;
+ for (; i < GetTimeCount(); ++i)
+ {
+ if (!GetTime(i))
+ break;
+ }
+ Time newTime(i);
+ if (ini)
+ newTime.ImportIni(*ini);
+ LogSubmoduleNew("Pokemod", id, "time", i);
+ times.push_back(newTime);
+}
+
+void PokeGen::PokeMod::Pokemod::DeleteTime(const unsigned _id)
+{
+ LogSubmoduleRemoveStart("Pokemod", id, "time", _id);
+ for (std::vector<Time>::iterator i = times.begin(); i != times.end(); ++i)
+ {
+ if (i->GetId() == _id)
+ {
+ LogSubmoduleRemoved("Pokemod", id, "time", _id);
+ times.erase(i);
+ }
+ }
+ LogSubmoduleRemoveFail("Pokemod", id, "time", _id);
+}
+
+void PokeGen::PokeMod::Pokemod::DeleteTime(const String &n)
+{
+ LogSubmoduleRemoveStart("Pokemod", id, "time", n);
+ for (std::vector<Time>::iterator i = times.begin(); i != times.end(); ++i)
+ {
+ if (i->GetName() == n)
+ {
+ LogSubmoduleRemoved("Pokemod", id, "time", n);
+ times.erase(i);
+ }
+ }
+ LogSubmoduleRemoveFail("Pokemod", id, "time", n);
+}
+
+const PokeGen::PokeMod::Type *PokeGen::PokeMod::Pokemod::GetType(const unsigned _id) const
+{
+ LogSubmoduleFetch("Pokemod", id, "type", _id);
+ for (unsigned i = 0; i < GetTypeCount(); ++i)
+ {
+ if (types[i].GetId() == _id)
+ return &types[i];
+ }
+ LogSubmoduleFetchFail("Pokemod", id, "type", _id);
+ return NULL;
+}
+
+const PokeGen::PokeMod::Type *PokeGen::PokeMod::Pokemod::GetType(const String &n) const
+{
+ LogSubmoduleFetch("Pokemod", id, "type", n);
+ for (unsigned i = 0; i < GetTypeCount(); ++i)
+ {
+ if (types[i].GetName() == n)
+ return &types[i];
+ }
+ LogSubmoduleFetchFail("Pokemod", id, "type", n);
+ return NULL;
+}
+
+unsigned PokeGen::PokeMod::Pokemod::GetTypeCount() const
+{
+ LogSubmoduleCount("Pokemod", id, "type");
+ return types.size();
+}
+
+void PokeGen::PokeMod::Pokemod::NewType(Ini *const ini)
+{
+ unsigned i = 0;
+ for (; i < GetTypeCount(); ++i)
+ {
+ if (!GetType(i))
+ break;
+ }
+ Type newType(i);
+ if (ini)
+ newType.ImportIni(*ini);
+ LogSubmoduleNew("Pokemod", id, "type", i);
+ types.push_back(newType);
+ typeChart.AddCol(Frac(1, 1));
+ typeChart.AddRow(Frac(1, 1));
+ typeChart[0][typeChart.GetHeight() - 1] = Frac(i, 1, true);
+ typeChart[typeChart.GetHeight() - 1][0] = Frac(i, 1, true);
+}
+
+void PokeGen::PokeMod::Pokemod::DeleteType(const unsigned _id)
+{
+ LogSubmoduleRemoveStart("Pokemod", id, "type", _id);
+ for (std::vector<Type>::iterator i = types.begin(); i != types.end(); ++i)
+ {
+ if (i->GetId() == _id)
+ {
+ LogSubmoduleRemoved("Pokemod", id, "type", _id);
+ for (unsigned j = 0; j < typeChart.GetWidth(); ++j)
+ {
+ if (typeChart[j][0].GetNum() == _id)
+ {
+ typeChart.DeleteCol(j);
+ typeChart.DeleteRow(j);
+ }
+ }
+ types.erase(i);
+ }
+ }
+ LogSubmoduleRemoveFail("Pokemod", id, "type", _id);
+}
+
+void PokeGen::PokeMod::Pokemod::DeleteType(const String &n)
+{
+ LogSubmoduleRemoveStart("Pokemod", id, "type", n);
+ for (std::vector<Type>::iterator i = types.begin(); i != types.end(); ++i)
+ {
+ if (i->GetName() == n)
+ {
+ LogSubmoduleRemoved("Pokemod", id, "type", n);
+ for (unsigned j = 0; j < typeChart.GetWidth(); ++j)
+ {
+ if (typeChart[j][0].GetNum() == i->GetId())
+ {
+ typeChart.DeleteCol(j);
+ typeChart.DeleteRow(j);
+ }
+ }
+ types.erase(i);
+ }
+ }
+ LogSubmoduleRemoveFail("Pokemod", id, "type", n);
}
|
