summaryrefslogtreecommitdiffstats
path: root/sigscript/SpeciesWrapper.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-09-07 18:49:29 +0000
committerBen Boeckel <MathStuf@gmail.com>2008-09-07 18:49:29 +0000
commitf80268eb885e28c603cc88523cfce2751d1448e1 (patch)
treed3e0a8b482f7d2a4bd177ecc300aa407177a42de /sigscript/SpeciesWrapper.cpp
parent48f9e57b1638ba047ca2dcd6d3251ee90bf9ef69 (diff)
downloadsigen-f80268eb885e28c603cc88523cfce2751d1448e1.tar.gz
sigen-f80268eb885e28c603cc88523cfce2751d1448e1.tar.xz
sigen-f80268eb885e28c603cc88523cfce2751d1448e1.zip
[FIX] Added a static poll method to Fraction
[FIX] More Arena stuff fleshed out [FIX] Added priority scripts to Ability and Move [FIX] A SigmodWrapper pointer is now passed around the containments [FIX] Config now has templated methods for retrieving values git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@253 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'sigscript/SpeciesWrapper.cpp')
-rw-r--r--sigscript/SpeciesWrapper.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/sigscript/SpeciesWrapper.cpp b/sigscript/SpeciesWrapper.cpp
index 7eef05e8..5f1b1a72 100644
--- a/sigscript/SpeciesWrapper.cpp
+++ b/sigscript/SpeciesWrapper.cpp
@@ -102,22 +102,22 @@ int Sigscript::SpeciesWrapper::catchValue() const
Sigmod::Fraction Sigscript::SpeciesWrapper::runChance() const
{
- if (value("runChance").canConvert<Sigmod::Fraction>())
- return value("runChance").value<Sigmod::Fraction>();
+ if (hasValueOfType<Sigmod::Fraction>("runChance"))
+ return valueOfType<Sigmod::Fraction>("runChance");
return m_species->runChance();
}
Sigmod::Fraction Sigscript::SpeciesWrapper::fleeChance() const
{
- if (value("fleeChance").canConvert<Sigmod::Fraction>())
- return value("fleeChance").value<Sigmod::Fraction>();
+ if (hasValueOfType<Sigmod::Fraction>("fleeChance"))
+ return valueOfType<Sigmod::Fraction>("fleeChance");
return m_species->fleeChance();
}
Sigmod::Fraction Sigscript::SpeciesWrapper::itemChance() const
{
- if (value("itemChance").canConvert<Sigmod::Fraction>())
- return value("itemChance").value<Sigmod::Fraction>();
+ if (hasValueOfType<Sigmod::Fraction>("itemChance"))
+ return valueOfType<Sigmod::Fraction>("itemChance");
return m_species->itemChance();
}
@@ -173,8 +173,8 @@ Sigmod::Fraction Sigscript::SpeciesWrapper::genderFactor() const
int Sigscript::SpeciesWrapper::eggSpecies() const
{
- if (value("eggSpecies").canConvert<int>())
- return value("eggSpecies").toInt();
+ if (hasValueOfType<int>("eggSpecies"))
+ return valueOfType<int>("eggSpecies");
return m_species->eggSpecies();
}