summaryrefslogtreecommitdiffstats
path: root/pokemod/MapTrainerPokemon.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pokemod/MapTrainerPokemon.cpp')
-rw-r--r--pokemod/MapTrainerPokemon.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/pokemod/MapTrainerPokemon.cpp b/pokemod/MapTrainerPokemon.cpp
index 020e4a8a..531e4052 100644
--- a/pokemod/MapTrainerPokemon.cpp
+++ b/pokemod/MapTrainerPokemon.cpp
@@ -22,7 +22,7 @@
#include "MapTrainerPokemon.h"
-PokeGen::PokeMod::MapTrainerPokemon::MapTrainerPokemon(const Pokemod& par, const unsigned _id) :
+PokeMod::MapTrainerPokemon::MapTrainerPokemon(const Pokemod& par, const unsigned _id) :
Object(par, _id),
species(UINT_MAX),
level(UINT_MAX),
@@ -30,13 +30,13 @@ PokeGen::PokeMod::MapTrainerPokemon::MapTrainerPokemon(const Pokemod& par, const
{
}
-PokeGen::PokeMod::MapTrainerPokemon::MapTrainerPokemon(const Pokemod& par, const QString& fname, const unsigned _id) :
+PokeMod::MapTrainerPokemon::MapTrainerPokemon(const Pokemod& par, const QString& fname, const unsigned _id) :
Object(par, _id)
{
load(fname, _id);
}
-bool PokeGen::PokeMod::MapTrainerPokemon::validate() const
+bool PokeMod::MapTrainerPokemon::validate() const
{
bool valid = true;
pokemod.validationMsg(QString("---------Pokémon with id %1---").arg(id), Pokemod::V_Msg);
@@ -87,7 +87,7 @@ bool PokeGen::PokeMod::MapTrainerPokemon::validate() const
return valid;
}
-void PokeGen::PokeMod::MapTrainerPokemon::load(const QString& fname, const unsigned _id) throw(Exception)
+void PokeMod::MapTrainerPokemon::load(const QString& fname, const unsigned _id) throw(Exception)
{
Ini ini(fname);
if (_id == UINT_MAX)
@@ -109,7 +109,7 @@ void PokeGen::PokeMod::MapTrainerPokemon::load(const QString& fname, const unsig
}
}
-void PokeGen::PokeMod::MapTrainerPokemon::save(const QString& map, const QString& trainer) const throw(Exception)
+void PokeMod::MapTrainerPokemon::save(const QString& map, const QString& trainer) const throw(Exception)
{
Ini ini;
ini.addField("id", id);
@@ -122,50 +122,50 @@ void PokeGen::PokeMod::MapTrainerPokemon::save(const QString& map, const QString
ini.save(QString("%1/map/%2/trainer/%3/team/%4.pini").arg(pokemod.getPath()).arg(map).arg(trainer).arg(id));
}
-void PokeGen::PokeMod::MapTrainerPokemon::setSpecies(const unsigned s) throw(BoundsException)
+void PokeMod::MapTrainerPokemon::setSpecies(const unsigned s) throw(BoundsException)
{
if (pokemod.getSpeciesByID(s) == UINT_MAX)
throw(BoundsException("MapTrainerPokemon", "species"));
species = s;
}
-void PokeGen::PokeMod::MapTrainerPokemon::setLevel(const unsigned l) throw(BoundsException)
+void PokeMod::MapTrainerPokemon::setLevel(const unsigned l) throw(BoundsException)
{
if (pokemod.getRules().getMaxLevel() < l)
throw(BoundsException("MapTrainerPokemon", "level"));
level = l;
}
-void PokeGen::PokeMod::MapTrainerPokemon::setNature(const unsigned n) throw(BoundsException)
+void PokeMod::MapTrainerPokemon::setNature(const unsigned n) throw(BoundsException)
{
if (!pokemod.getRules().getNatureAllowed() || (pokemod.getNatureByID(n) == UINT_MAX))
throw(BoundsException("MapTrainerPokemon", "nature"));
nature = n;
}
-unsigned PokeGen::PokeMod::MapTrainerPokemon::getSpecies() const
+unsigned PokeMod::MapTrainerPokemon::getSpecies() const
{
return species;
}
-unsigned PokeGen::PokeMod::MapTrainerPokemon::getLevel() const
+unsigned PokeMod::MapTrainerPokemon::getLevel() const
{
return level;
}
-unsigned PokeGen::PokeMod::MapTrainerPokemon::getNature() const
+unsigned PokeMod::MapTrainerPokemon::getNature() const
{
return nature;
}
-unsigned PokeGen::PokeMod::MapTrainerPokemon::getItem(const unsigned i) const throw(IndexException)
+unsigned PokeMod::MapTrainerPokemon::getItem(const unsigned i) const throw(IndexException)
{
if (getItemCount() <= i)
throw(IndexException("MapTrainerPokemon"));
return items.at(i);
}
-unsigned PokeGen::PokeMod::MapTrainerPokemon::getItemByID(const unsigned _id) const
+unsigned PokeMod::MapTrainerPokemon::getItemByID(const unsigned _id) const
{
for (unsigned i = 0; i < getItemCount(); ++i)
{
@@ -175,12 +175,12 @@ unsigned PokeGen::PokeMod::MapTrainerPokemon::getItemByID(const unsigned _id) co
return UINT_MAX;
}
-unsigned PokeGen::PokeMod::MapTrainerPokemon::getItemCount() const
+unsigned PokeMod::MapTrainerPokemon::getItemCount() const
{
return items.size();
}
-void PokeGen::PokeMod::MapTrainerPokemon::newItem(const unsigned i) throw(Exception)
+void PokeMod::MapTrainerPokemon::newItem(const unsigned i) throw(Exception)
{
if (pokemod.getRules().getHoldItems() <= getItemCount())
throw(Exception("MapTrainerPokemon", "too many items"));
@@ -189,14 +189,14 @@ void PokeGen::PokeMod::MapTrainerPokemon::newItem(const unsigned i) throw(Except
items.append(i);
}
-void PokeGen::PokeMod::MapTrainerPokemon::deleteItem(const unsigned i) throw(IndexException)
+void PokeMod::MapTrainerPokemon::deleteItem(const unsigned i) throw(IndexException)
{
if (getItemCount() <= i)
throw(IndexException("MapTrainerPokemon"));
items.erase(items.begin() + i);
}
-PokeGen::PokeMod::MapTrainerPokemon& PokeGen::PokeMod::MapTrainerPokemon::operator=(const MapTrainerPokemon& rhs)
+PokeMod::MapTrainerPokemon& PokeMod::MapTrainerPokemon::operator=(const MapTrainerPokemon& rhs)
{
if (this == &rhs)
return *this;