summaryrefslogtreecommitdiffstats
path: root/pokemod/Move.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-01-19 01:22:22 +0000
committerBen Boeckel <MathStuf@gmail.com>2008-01-19 01:22:22 +0000
commit342d0201b07d9030fced2f3baf3ecdefc841879a (patch)
treef0715cc7b267e2ce2bc93971d9e95c7e0c9b2b62 /pokemod/Move.cpp
parentd017d90324a439dfb4bd3f25d30deb672bc40fd4 (diff)
downloadsigen-342d0201b07d9030fced2f3baf3ecdefc841879a.tar.gz
sigen-342d0201b07d9030fced2f3baf3ecdefc841879a.tar.xz
sigen-342d0201b07d9030fced2f3baf3ecdefc841879a.zip
[DEL] Removed PokeGen namespace
[ADD] general/AudioCache.h completed [DEL] VERSION removed from subdir .pro files [DEL] audio/ git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@33 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemod/Move.cpp')
-rw-r--r--pokemod/Move.cpp98
1 files changed, 49 insertions, 49 deletions
diff --git a/pokemod/Move.cpp b/pokemod/Move.cpp
index 4e67f4cf..b31ac792 100644
--- a/pokemod/Move.cpp
+++ b/pokemod/Move.cpp
@@ -22,10 +22,10 @@
#include "Move.h"
-const char* PokeGen::PokeMod::Move::TargetStr[PokeGen::PokeMod::Move::T_End] = {"Player", "Enemy", "Both", "Random"};
-const char* PokeGen::PokeMod::Move::ChoiceStr[PokeGen::PokeMod::Move::C_End] = {"Player", "Enemy", "Random"};
+const char* PokeMod::Move::TargetStr[PokeMod::Move::T_End] = {"Player", "Enemy", "Both", "Random"};
+const char* PokeMod::Move::ChoiceStr[PokeMod::Move::C_End] = {"Player", "Enemy", "Random"};
-PokeGen::PokeMod::Move::Move(const Pokemod& par, const unsigned _id) :
+PokeMod::Move::Move(const Pokemod& par, const unsigned _id) :
Object(par, _id),
name(""),
accuracy(1, 1),
@@ -44,19 +44,19 @@ PokeGen::PokeMod::Move::Move(const Pokemod& par, const unsigned _id) :
{
}
-PokeGen::PokeMod::Move::Move(const Pokemod& par, const Move& m, const unsigned _id) :
+PokeMod::Move::Move(const Pokemod& par, const Move& m, const unsigned _id) :
Object(par, _id)
{
*this = m;
}
-PokeGen::PokeMod::Move::Move(const Pokemod& par, const QString& fname, const unsigned _id) :
+PokeMod::Move::Move(const Pokemod& par, const QString& fname, const unsigned _id) :
Object(par, _id)
{
load(fname, _id);
}
-bool PokeGen::PokeMod::Move::validate() const
+bool PokeMod::Move::validate() const
{
bool valid = true;
pokemod.validationMsg(QString("---Move \"%1\" with id %2---").arg(name).arg(id), Pokemod::V_Msg);
@@ -116,7 +116,7 @@ bool PokeGen::PokeMod::Move::validate() const
return valid;
}
-unsigned PokeGen::PokeMod::Move::getNewId() const
+unsigned PokeMod::Move::getNewId() const
{
unsigned i = 0;
for (; (i < getEffectCount()) && (getEffectByID(i) != UINT_MAX); ++i)
@@ -124,7 +124,7 @@ unsigned PokeGen::PokeMod::Move::getNewId() const
return i;
}
-void PokeGen::PokeMod::Move::load(const QString& fname, const unsigned _id) throw(Exception)
+void PokeMod::Move::load(const QString& fname, const unsigned _id) throw(Exception)
{
Ini ini(fname);
if (_id == UINT_MAX)
@@ -161,7 +161,7 @@ void PokeGen::PokeMod::Move::load(const QString& fname, const unsigned _id) thro
}
}
-void PokeGen::PokeMod::Move::save() const throw(Exception)
+void PokeMod::Move::save() const throw(Exception)
{
Ini ini;
ini.addField("id", id);
@@ -186,186 +186,186 @@ void PokeGen::PokeMod::Move::save() const throw(Exception)
i.next().save(name);
}
-void PokeGen::PokeMod::Move::setName(const QString& n)
+void PokeMod::Move::setName(const QString& n)
{
name = n;
}
-void PokeGen::PokeMod::Move::setAccuracy(const unsigned n, const unsigned d) throw(Exception)
+void PokeMod::Move::setAccuracy(const unsigned n, const unsigned d) throw(Exception)
{
accuracy.set(n, d);
}
-void PokeGen::PokeMod::Move::setAccuracyNum(const unsigned n) throw(Exception)
+void PokeMod::Move::setAccuracyNum(const unsigned n) throw(Exception)
{
accuracy.setNum(n);
}
-void PokeGen::PokeMod::Move::setAccuracyDenom(const unsigned d) throw(Exception)
+void PokeMod::Move::setAccuracyDenom(const unsigned d) throw(Exception)
{
accuracy.setDenom(d);
}
-void PokeGen::PokeMod::Move::setType(const unsigned t) throw(BoundsException)
+void PokeMod::Move::setType(const unsigned t) throw(BoundsException)
{
if (pokemod.getTypeByID(t) == UINT_MAX)
throw(BoundsException("Move", "type"));
type = t;
}
-void PokeGen::PokeMod::Move::setSpecial(const bool s)
+void PokeMod::Move::setSpecial(const bool s)
{
special = s;
}
-void PokeGen::PokeMod::Move::setPowerPoints(const unsigned p) throw(BoundsException)
+void PokeMod::Move::setPowerPoints(const unsigned p) throw(BoundsException)
{
if (!p)
throw(BoundsException("Move", "powerPoints"));
powerPoints = p;
}
-void PokeGen::PokeMod::Move::setTarget(const unsigned t) throw(BoundsException)
+void PokeMod::Move::setTarget(const unsigned t) throw(BoundsException)
{
if (T_End <= t)
throw(BoundsException("Move", "target"));
target = t;
}
-void PokeGen::PokeMod::Move::setNumTargets(const unsigned n) throw(BoundsException)
+void PokeMod::Move::setNumTargets(const unsigned n) throw(BoundsException)
{
if (!n || ((pokemod.getRules().getMaxFight() << 1) < n))
throw(BoundsException("Move", "numTargets"));
numTargets = n;
}
-void PokeGen::PokeMod::Move::setTargetChoice(const unsigned t) throw(BoundsException)
+void PokeMod::Move::setTargetChoice(const unsigned t) throw(BoundsException)
{
if (C_End <= t)
throw(BoundsException("Move", "targetChoice"));
targetChoice = t;
}
-void PokeGen::PokeMod::Move::setIgnoreAccuracy(const bool i)
+void PokeMod::Move::setIgnoreAccuracy(const bool i)
{
ignoreAccuracy = i;
}
-void PokeGen::PokeMod::Move::setCanFlinch(const bool c)
+void PokeMod::Move::setCanFlinch(const bool c)
{
canFlinch = c;
}
-void PokeGen::PokeMod::Move::setCanRandom(const bool c)
+void PokeMod::Move::setCanRandom(const bool c)
{
canRandom = c;
}
-void PokeGen::PokeMod::Move::setCanSnatch(const bool c)
+void PokeMod::Move::setCanSnatch(const bool c)
{
canSnatch = c;
}
-void PokeGen::PokeMod::Move::setSound(const bool s)
+void PokeMod::Move::setSound(const bool s)
{
sound = s;
}
-QString PokeGen::PokeMod::Move::getName() const
+QString PokeMod::Move::getName() const
{
return name;
}
-PokeGen::Frac PokeGen::PokeMod::Move::getAccuracy() const
+Frac PokeMod::Move::getAccuracy() const
{
return accuracy;
}
-unsigned PokeGen::PokeMod::Move::getAccuracyNum() const
+unsigned PokeMod::Move::getAccuracyNum() const
{
return accuracy.getNum();
}
-unsigned PokeGen::PokeMod::Move::getAccuracyDenom() const
+unsigned PokeMod::Move::getAccuracyDenom() const
{
return accuracy.getDenom();
}
-unsigned PokeGen::PokeMod::Move::getType() const
+unsigned PokeMod::Move::getType() const
{
return type;
}
-bool PokeGen::PokeMod::Move::getSpecial() const
+bool PokeMod::Move::getSpecial() const
{
return special;
}
-unsigned PokeGen::PokeMod::Move::getPowerPoints() const
+unsigned PokeMod::Move::getPowerPoints() const
{
return powerPoints;
}
-unsigned PokeGen::PokeMod::Move::getTarget() const
+unsigned PokeMod::Move::getTarget() const
{
return target;
}
-unsigned PokeGen::PokeMod::Move::getNumTargets() const
+unsigned PokeMod::Move::getNumTargets() const
{
return numTargets;
}
-unsigned PokeGen::PokeMod::Move::getTargetChoice() const
+unsigned PokeMod::Move::getTargetChoice() const
{
return targetChoice;
}
-bool PokeGen::PokeMod::Move::getIgnoreAccuracy() const
+bool PokeMod::Move::getIgnoreAccuracy() const
{
return ignoreAccuracy;
}
-bool PokeGen::PokeMod::Move::getCanFlinch() const
+bool PokeMod::Move::getCanFlinch() const
{
return canFlinch;
}
-bool PokeGen::PokeMod::Move::getCanRandom() const
+bool PokeMod::Move::getCanRandom() const
{
return canRandom;
}
-bool PokeGen::PokeMod::Move::getCanSnatch() const
+bool PokeMod::Move::getCanSnatch() const
{
return canSnatch;
}
-bool PokeGen::PokeMod::Move::getSound() const
+bool PokeMod::Move::getSound() const
{
return sound;
}
-QString PokeGen::PokeMod::Move::getDescription() const
+QString PokeMod::Move::getDescription() const
{
return description;
}
-const PokeGen::PokeMod::MoveEffect& PokeGen::PokeMod::Move::getEffect(const unsigned i) const throw(IndexException)
+const PokeMod::MoveEffect& PokeMod::Move::getEffect(const unsigned i) const throw(IndexException)
{
if (getEffectCount() <= i)
throw(IndexException("Move"));
return effects.at(i);
}
-PokeGen::PokeMod::MoveEffect& PokeGen::PokeMod::Move::getEffect(const unsigned i) throw(IndexException)
+PokeMod::MoveEffect& PokeMod::Move::getEffect(const unsigned i) throw(IndexException)
{
if (getEffectCount() <= i)
throw(IndexException("Move"));
return effects[i];
}
-unsigned PokeGen::PokeMod::Move::getEffectByID(const unsigned _id) const
+unsigned PokeMod::Move::getEffectByID(const unsigned _id) const
{
for (unsigned i = 0; i < getEffectCount(); ++i)
{
@@ -375,37 +375,37 @@ unsigned PokeGen::PokeMod::Move::getEffectByID(const unsigned _id) const
return UINT_MAX;
}
-unsigned PokeGen::PokeMod::Move::getEffectCount() const
+unsigned PokeMod::Move::getEffectCount() const
{
return effects.size();
}
-PokeGen::PokeMod::MoveEffect& PokeGen::PokeMod::Move::newEffect()
+PokeMod::MoveEffect& PokeMod::Move::newEffect()
{
effects.append(MoveEffect(pokemod, getNewId()));
return effects[getEffectCount() - 1];
}
-PokeGen::PokeMod::MoveEffect& PokeGen::PokeMod::Move::newEffect(const QString& fname)
+PokeMod::MoveEffect& PokeMod::Move::newEffect(const QString& fname)
{
effects.append(MoveEffect(pokemod, fname, getNewId()));
return effects[getEffectCount() - 1];
}
-PokeGen::PokeMod::MoveEffect& PokeGen::PokeMod::Move::newEffect(const MoveEffect& e)
+PokeMod::MoveEffect& PokeMod::Move::newEffect(const MoveEffect& e)
{
effects.append(MoveEffect(pokemod, e, getNewId()));
return effects[getEffectCount() - 1];
}
-void PokeGen::PokeMod::Move::deleteEffect(const unsigned i) throw(IndexException)
+void PokeMod::Move::deleteEffect(const unsigned i) throw(IndexException)
{
if (getEffectCount() <= i)
throw(IndexException("Move"));
effects.removeAt(i);
}
-PokeGen::PokeMod::Move& PokeGen::PokeMod::Move::operator=(const Move& rhs)
+PokeMod::Move& PokeMod::Move::operator=(const Move& rhs)
{
if (this == &rhs)
return *this;