summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2007-05-26 13:36:39 +0000
committerBen Boeckel <MathStuf@gmail.com>2007-05-26 13:36:39 +0000
commitdc9682d704118840457aa3434711eba6e003eafc (patch)
tree40ccccb7c4a220b656ec92d61277a44380cf30bd
parent75b7d5c767428f7061365a186cb17a22de4112cc (diff)
const arguments where possible, EggGroup, Move beginnings
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@15 6ecfd1a5-f3ed-3746-8530-beee90d26b22
-rw-r--r--Changelog9
-rw-r--r--pokegen.cbp15
-rw-r--r--pokegen.layout139
-rw-r--r--pokemod/Ability.cpp10
-rw-r--r--pokemod/Ability.h11
-rw-r--r--pokemod/AbilityEffect.cpp30
-rw-r--r--pokemod/AbilityEffect.h30
-rw-r--r--pokemod/Author.cpp6
-rw-r--r--pokemod/Author.h6
-rw-r--r--pokemod/Badge.cpp20
-rw-r--r--pokemod/Badge.h20
-rw-r--r--pokemod/CoinItem.cpp14
-rw-r--r--pokemod/CoinItem.h14
-rw-r--r--pokemod/CoinList.cpp12
-rw-r--r--pokemod/CoinList.h12
-rw-r--r--pokemod/Dialog.cpp10
-rw-r--r--pokemod/Dialog.h10
-rw-r--r--pokemod/EggGroup.cpp110
-rw-r--r--pokemod/EggGroup.h58
-rw-r--r--pokemod/Flag.cpp6
-rw-r--r--pokemod/Flag.h6
-rw-r--r--pokemod/Frac.cpp14
-rw-r--r--pokemod/Frac.h14
-rw-r--r--pokemod/Ini.cpp8
-rw-r--r--pokemod/Ini.h8
-rw-r--r--pokemod/Item.cpp18
-rw-r--r--pokemod/Item.h16
-rw-r--r--pokemod/ItemEffect.cpp52
-rw-r--r--pokemod/ItemEffect.h56
-rw-r--r--pokemod/ItemStorage.cpp10
-rw-r--r--pokemod/ItemStorage.h10
-rw-r--r--pokemod/MapTrainerTeam.cpp14
-rw-r--r--pokemod/MapTrainerTeam.h16
-rw-r--r--pokemod/MapWildList.cpp30
-rw-r--r--pokemod/MapWildList.h24
-rw-r--r--pokemod/MapWildPokemon.cpp12
-rw-r--r--pokemod/MapWildPokemon.h12
-rw-r--r--pokemod/Matrix.h20
-rw-r--r--pokemod/Move.h108
-rw-r--r--pokemod/MoveEffect.cpp18
-rw-r--r--pokemod/MoveEffect.h18
-rw-r--r--pokemod/Nature.cpp10
-rw-r--r--pokemod/Nature.h11
-rw-r--r--pokemod/NatureEffect.cpp14
-rw-r--r--pokemod/NatureEffect.h14
-rw-r--r--pokemod/Object.h2
-rw-r--r--pokemod/Point.h8
-rw-r--r--pokemod/Pokemod.h100
-rw-r--r--pokemod/PokemonAbility.cpp10
-rw-r--r--pokemod/PokemonAbility.h10
-rw-r--r--pokemod/PokemonEvolution.cpp16
-rw-r--r--pokemod/PokemonEvolution.h16
-rw-r--r--pokemod/PokemonItem.cpp10
-rw-r--r--pokemod/PokemonItem.h10
-rw-r--r--pokemod/PokemonMove.cpp12
-rw-r--r--pokemod/PokemonMove.h12
-rw-r--r--pokemod/PokemonNature.cpp10
-rw-r--r--pokemod/PokemonNature.h10
-rw-r--r--pokemod/Ref.cpp2
-rw-r--r--pokemod/Ref.h2
-rw-r--r--pokemod/Store.cpp18
-rw-r--r--pokemod/Store.h16
-rw-r--r--pokemod/Time.cpp10
-rw-r--r--pokemod/Time.h10
-rw-r--r--pokemod/Type.cpp8
-rw-r--r--pokemod/Type.h8
-rw-r--r--pokemodr/gui/egggrouppanel.cpp233
-rw-r--r--pokemodr/gui/egggrouppanel.h127
68 files changed, 1200 insertions, 535 deletions
diff --git a/Changelog b/Changelog
index 5f515abf..fb5c1172 100644
--- a/Changelog
+++ b/Changelog
@@ -1,4 +1,13 @@
-----------------
+Rev: 15
+Date: 26 May 2007
+User: MathStuf
+-----------------
+[ADD] /pokemod/EggGroup.{h, cpp}
+[ADD] /pokemod/Move.h
+[FIX] Made arguments const where possible
+
+-----------------
Rev: 14
Date: 24 May 2007
User: MathStuf
diff --git a/pokegen.cbp b/pokegen.cbp
index 8e260f3c..445fcb6e 100644
--- a/pokegen.cbp
+++ b/pokegen.cbp
@@ -153,6 +153,16 @@
<Option target="pokegen" />
<Option target="pokemod-DLL" />
</Unit>
+ <Unit filename="pokemod\EggGroup.cpp">
+ <Option target="pokemodr" />
+ <Option target="pokegen" />
+ <Option target="pokemod-DLL" />
+ </Unit>
+ <Unit filename="pokemod\EggGroup.h">
+ <Option target="pokemodr" />
+ <Option target="pokegen" />
+ <Option target="pokemod-DLL" />
+ </Unit>
<Unit filename="pokemod\Flag.cpp">
<Option target="pokemod-DLL" />
</Unit>
@@ -234,6 +244,11 @@
<Unit filename="pokemod\Matrix.h">
<Option target="pokemod-DLL" />
</Unit>
+ <Unit filename="pokemod\Move.h">
+ <Option target="pokemodr" />
+ <Option target="pokegen" />
+ <Option target="pokemod-DLL" />
+ </Unit>
<Unit filename="pokemod\MoveEffect.cpp">
<Option target="pokemodr" />
<Option target="pokegen" />
diff --git a/pokegen.layout b/pokegen.layout
index 828ae9df..daf45f7a 100644
--- a/pokegen.layout
+++ b/pokegen.layout
@@ -2,7 +2,7 @@
<CodeBlocks_layout_file>
<ActiveTarget name="pokemod-DLL" />
<File name="Changelog" open="1" top="1" tabpos="1">
- <Cursor position="185" topLine="0" />
+ <Cursor position="37" topLine="0" />
</File>
<File name="STANDARDS" open="0" top="0" tabpos="0">
<Cursor position="2" topLine="0" />
@@ -26,208 +26,217 @@
<Cursor position="1408" topLine="0" />
</File>
<File name="pokemod\Ability.cpp" open="0" top="0" tabpos="2">
- <Cursor position="4420" topLine="117" />
+ <Cursor position="4791" topLine="148" />
</File>
<File name="pokemod\Ability.h" open="0" top="0" tabpos="2">
- <Cursor position="2059" topLine="0" />
+ <Cursor position="2113" topLine="35" />
</File>
<File name="pokemod\AbilityEffect.cpp" open="0" top="0" tabpos="2">
- <Cursor position="25165" topLine="622" />
+ <Cursor position="18220" topLine="805" />
</File>
<File name="pokemod\AbilityEffect.h" open="0" top="0" tabpos="3">
- <Cursor position="103" topLine="0" />
+ <Cursor position="2631" topLine="71" />
</File>
<File name="pokemod\Author.cpp" open="0" top="0" tabpos="4">
- <Cursor position="1444" topLine="24" />
+ <Cursor position="3120" topLine="162" />
</File>
<File name="pokemod\Author.h" open="0" top="0" tabpos="5">
- <Cursor position="2263" topLine="0" />
+ <Cursor position="1559" topLine="40" />
</File>
<File name="pokemod\Badge.cpp" open="0" top="0" tabpos="6">
- <Cursor position="7320" topLine="21" />
+ <Cursor position="7474" topLine="232" />
</File>
<File name="pokemod\Badge.h" open="0" top="0" tabpos="7">
- <Cursor position="1402" topLine="0" />
+ <Cursor position="2455" topLine="33" />
</File>
<File name="pokemod\CoinItem.cpp" open="0" top="0" tabpos="0">
- <Cursor position="1565" topLine="27" />
+ <Cursor position="5606" topLine="194" />
</File>
<File name="pokemod\CoinItem.h" open="0" top="0" tabpos="0">
- <Cursor position="1718" topLine="36" />
+ <Cursor position="1971" topLine="37" />
</File>
<File name="pokemod\CoinList.cpp" open="0" top="0" tabpos="0">
- <Cursor position="1599" topLine="32" />
+ <Cursor position="5678" topLine="176" />
</File>
<File name="pokemod\CoinList.h" open="0" top="0" tabpos="0">
- <Cursor position="2449" topLine="33" />
+ <Cursor position="2190" topLine="27" />
</File>
<File name="pokemod\Debug.cpp" open="0" top="0" tabpos="0">
<Cursor position="1588" topLine="27" />
</File>
<File name="pokemod\Debug.h" open="0" top="0" tabpos="4">
- <Cursor position="9129" topLine="0" />
+ <Cursor position="9129" topLine="18" />
</File>
<File name="pokemod\Dialog.cpp" open="0" top="0" tabpos="0">
- <Cursor position="2798" topLine="74" />
+ <Cursor position="2971" topLine="74" />
</File>
<File name="pokemod\Dialog.h" open="0" top="0" tabpos="0">
- <Cursor position="1501" topLine="24" />
+ <Cursor position="1869" topLine="24" />
+ </File>
+ <File name="pokemod\EggGroup.cpp" open="0" top="0" tabpos="0">
+ <Cursor position="1246" topLine="11" />
+ </File>
+ <File name="pokemod\EggGroup.h" open="0" top="0" tabpos="0">
+ <Cursor position="1603" topLine="25" />
</File>
<File name="pokemod\Flag.cpp" open="0" top="0" tabpos="8">
- <Cursor position="2832" topLine="0" />
+ <Cursor position="2093" topLine="54" />
</File>
<File name="pokemod\Flag.h" open="0" top="0" tabpos="9">
- <Cursor position="1790" topLine="0" />
+ <Cursor position="1628" topLine="24" />
</File>
<File name="pokemod\Frac.cpp" open="0" top="0" tabpos="10">
- <Cursor position="1853" topLine="0" />
+ <Cursor position="3630" topLine="124" />
</File>
<File name="pokemod\Frac.h" open="0" top="0" tabpos="11">
- <Cursor position="1571" topLine="0" />
+ <Cursor position="1774" topLine="32" />
</File>
<File name="pokemod\Ini.cpp" open="0" top="0" tabpos="3">
- <Cursor position="3247" topLine="0" />
+ <Cursor position="3726" topLine="141" />
</File>
<File name="pokemod\Ini.h" open="0" top="0" tabpos="12">
- <Cursor position="1745" topLine="30" />
+ <Cursor position="2392" topLine="42" />
</File>
<File name="pokemod\Item.cpp" open="0" top="0" tabpos="2">
- <Cursor position="1538" topLine="25" />
+ <Cursor position="7138" topLine="244" />
</File>
<File name="pokemod\Item.h" open="0" top="0" tabpos="0">
- <Cursor position="2095" topLine="33" />
+ <Cursor position="2434" topLine="49" />
</File>
<File name="pokemod\ItemEffect.cpp" open="0" top="0" tabpos="0">
- <Cursor position="1647" topLine="0" />
+ <Cursor position="23729" topLine="785" />
</File>
<File name="pokemod\ItemEffect.h" open="0" top="0" tabpos="0">
- <Cursor position="2919" topLine="0" />
+ <Cursor position="2953" topLine="52" />
</File>
<File name="pokemod\ItemStorage.cpp" open="0" top="0" tabpos="0">
- <Cursor position="1579" topLine="27" />
+ <Cursor position="3945" topLine="119" />
</File>
<File name="pokemod\ItemStorage.h" open="0" top="0" tabpos="0">
- <Cursor position="103" topLine="0" />
+ <Cursor position="1851" topLine="21" />
</File>
<File name="pokemod\MapTrainerTeam.cpp" open="0" top="0" tabpos="3">
- <Cursor position="1578" topLine="12" />
+ <Cursor position="5334" topLine="149" />
</File>
<File name="pokemod\MapTrainerTeam.h" open="0" top="0" tabpos="0">
- <Cursor position="1743" topLine="24" />
+ <Cursor position="2186" topLine="30" />
</File>
<File name="pokemod\MapWildList.cpp" open="0" top="0" tabpos="2">
- <Cursor position="1612" topLine="21" />
+ <Cursor position="8427" topLine="265" />
</File>
<File name="pokemod\MapWildList.h" open="0" top="0" tabpos="0">
- <Cursor position="1775" topLine="30" />
+ <Cursor position="2263" topLine="36" />
</File>
<File name="pokemod\MapWildPokemon.cpp" open="0" top="0" tabpos="0">
- <Cursor position="1590" topLine="24" />
+ <Cursor position="5304" topLine="151" />
</File>
<File name="pokemod\MapWildPokemon.h" open="0" top="0" tabpos="0">
- <Cursor position="1872" topLine="34" />
+ <Cursor position="1977" topLine="31" />
</File>
<File name="pokemod\Matrix.h" open="0" top="0" tabpos="4">
- <Cursor position="3839" topLine="0" />
+ <Cursor position="5046" topLine="219" />
+ </File>
+ <File name="pokemod\Move.h" open="1" top="0" tabpos="2">
+ <Cursor position="0" topLine="0" />
</File>
<File name="pokemod\MoveEffect.cpp" open="0" top="0" tabpos="0">
- <Cursor position="1557" topLine="33" />
+ <Cursor position="4401" topLine="138" />
</File>
<File name="pokemod\MoveEffect.h" open="0" top="0" tabpos="0">
- <Cursor position="2518" topLine="45" />
+ <Cursor position="2122" topLine="33" />
</File>
<File name="pokemod\Nature.cpp" open="0" top="0" tabpos="5">
- <Cursor position="4418" topLine="7" />
+ <Cursor position="4900" topLine="157" />
</File>
<File name="pokemod\Nature.h" open="0" top="0" tabpos="4">
- <Cursor position="1307" topLine="14" />
+ <Cursor position="1980" topLine="32" />
</File>
<File name="pokemod\NatureEffect.cpp" open="0" top="0" tabpos="0">
- <Cursor position="5219" topLine="121" />
+ <Cursor position="4104" topLine="97" />
</File>
<File name="pokemod\NatureEffect.h" open="0" top="0" tabpos="0">
- <Cursor position="2253" topLine="27" />
+ <Cursor position="1945" topLine="36" />
</File>
<File name="pokemod\Object.cpp" open="0" top="0" tabpos="0">
<Cursor position="1643" topLine="16" />
</File>
<File name="pokemod\Object.h" open="0" top="0" tabpos="0">
- <Cursor position="1644" topLine="0" />
+ <Cursor position="1532" topLine="27" />
</File>
<File name="pokemod\Path.cpp" open="0" top="0" tabpos="17">
<Cursor position="1503" topLine="0" />
</File>
<File name="pokemod\Path.h" open="0" top="0" tabpos="18">
- <Cursor position="1744" topLine="0" />
+ <Cursor position="1696" topLine="19" />
</File>
<File name="pokemod\Point.cpp" open="0" top="0" tabpos="19">
- <Cursor position="1508" topLine="0" />
+ <Cursor position="1631" topLine="11" />
</File>
<File name="pokemod\Point.h" open="0" top="0" tabpos="20">
- <Cursor position="1594" topLine="0" />
+ <Cursor position="1891" topLine="21" />
</File>
<File name="pokemod\Pokemod.h" open="0" top="0" tabpos="0">
- <Cursor position="125" topLine="0" />
+ <Cursor position="4380" topLine="108" />
</File>
<File name="pokemod\PokemonAbility.cpp" open="0" top="0" tabpos="0">
- <Cursor position="1580" topLine="18" />
+ <Cursor position="4222" topLine="114" />
</File>
<File name="pokemod\PokemonAbility.h" open="0" top="0" tabpos="0">
- <Cursor position="1743" topLine="27" />
+ <Cursor position="1908" topLine="27" />
</File>
<File name="pokemod\PokemonEvolution.cpp" open="0" top="0" tabpos="0">
- <Cursor position="1642" topLine="18" />
+ <Cursor position="5820" topLine="202" />
</File>
<File name="pokemod\PokemonEvolution.h" open="0" top="0" tabpos="0">
- <Cursor position="1765" topLine="24" />
+ <Cursor position="2104" topLine="39" />
</File>
<File name="pokemod\PokemonItem.cpp" open="0" top="0" tabpos="0">
- <Cursor position="1571" topLine="27" />
+ <Cursor position="4246" topLine="111" />
</File>
<File name="pokemod\PokemonItem.h" open="0" top="0" tabpos="0">
- <Cursor position="1740" topLine="30" />
+ <Cursor position="1899" topLine="30" />
</File>
<File name="pokemod\PokemonMove.cpp" open="0" top="0" tabpos="0">
- <Cursor position="1553" topLine="30" />
+ <Cursor position="4723" topLine="126" />
</File>
<File name="pokemod\PokemonMove.h" open="0" top="0" tabpos="0">
- <Cursor position="1719" topLine="21" />
+ <Cursor position="1826" topLine="27" />
</File>
<File name="pokemod\PokemonNature.cpp" open="0" top="0" tabpos="0">
- <Cursor position="1570" topLine="27" />
+ <Cursor position="4156" topLine="121" />
</File>
<File name="pokemod\PokemonNature.h" open="0" top="0" tabpos="0">
- <Cursor position="1712" topLine="27" />
+ <Cursor position="1898" topLine="27" />
</File>
<File name="pokemod\Ref.cpp" open="0" top="0" tabpos="0">
- <Cursor position="103" topLine="0" />
+ <Cursor position="1208" topLine="3" />
</File>
<File name="pokemod\Ref.h" open="0" top="0" tabpos="0">
- <Cursor position="3422" topLine="86" />
+ <Cursor position="1359" topLine="12" />
</File>
<File name="pokemod\Store.cpp" open="0" top="0" tabpos="0">
- <Cursor position="1498" topLine="21" />
+ <Cursor position="5520" topLine="174" />
</File>
<File name="pokemod\Store.h" open="0" top="0" tabpos="0">
- <Cursor position="103" topLine="0" />
+ <Cursor position="2137" topLine="33" />
</File>
<File name="pokemod\String.cpp" open="0" top="0" tabpos="0">
<Cursor position="3983" topLine="0" />
</File>
<File name="pokemod\String.h" open="0" top="0" tabpos="0">
- <Cursor position="1715" topLine="0" />
+ <Cursor position="388" topLine="0" />
</File>
<File name="pokemod\Time.cpp" open="0" top="0" tabpos="0">
- <Cursor position="1479" topLine="18" />
+ <Cursor position="4074" topLine="131" />
</File>
<File name="pokemod\Time.h" open="0" top="0" tabpos="0">
- <Cursor position="103" topLine="0" />
+ <Cursor position="1809" topLine="30" />
</File>
<File name="pokemod\Type.cpp" open="0" top="0" tabpos="0">
- <Cursor position="892" topLine="21" />
+ <Cursor position="3109" topLine="92" />
</File>
<File name="pokemod\Type.h" open="0" top="0" tabpos="0">
- <Cursor position="103" topLine="0" />
+ <Cursor position="1404" topLine="27" />
</File>
<File name="pokemod\pokemod_inc.h" open="0" top="0" tabpos="0">
<Cursor position="1828" topLine="0" />
diff --git a/pokemod/Ability.cpp b/pokemod/Ability.cpp
index 6b298c6a..c3996cf2 100644
--- a/pokemod/Ability.cpp
+++ b/pokemod/Ability.cpp
@@ -24,7 +24,7 @@
#include "Ability.h"
-PokeGen::PokeMod::Ability::Ability(unsigned _id)
+PokeGen::PokeMod::Ability::Ability(const unsigned _id)
{
LogCtor("Ability", id);
name = "";
@@ -32,7 +32,7 @@ PokeGen::PokeMod::Ability::Ability(unsigned _id)
id = _id;
}
-PokeGen::PokeMod::Ability::Ability(Ini &ini, unsigned _id)
+PokeGen::PokeMod::Ability::Ability(Ini &ini, const unsigned _id)
{
LogCtorIni("Ability", id);
ImportIni(ini, _id);
@@ -109,7 +109,7 @@ void PokeGen::PokeMod::Ability::Validate(const wxListBox &output)
}
#endif
-void PokeGen::PokeMod::Ability::ImportIni(Ini &ini, unsigned _id)
+void PokeGen::PokeMod::Ability::ImportIni(Ini &ini, const unsigned _id)
{
LogImportStart("Ability");
if (_id == UINT_MAX)
@@ -151,7 +151,7 @@ PokeGen::PokeMod::String PokeGen::PokeMod::Ability::GetName() const
return name;
}
-PokeGen::PokeMod::AbilityEffect *PokeGen::PokeMod::Ability::GetAbilityEffect(unsigned _id)
+PokeGen::PokeMod::AbilityEffect *PokeGen::PokeMod::Ability::GetAbilityEffect(const unsigned _id)
{
LogSubmoduleFetch("Ability", id, "effect", _id, name);
for (unsigned i = 0; i < GetAbilityEffectCount(); ++i)
@@ -185,7 +185,7 @@ void PokeGen::PokeMod::Ability::NewAbilityEffect(Ini *const ini)
effects.push_back(newAbilityEffect);
}
-void PokeGen::PokeMod::Ability::DeleteAbilityEffect(unsigned _id)
+void PokeGen::PokeMod::Ability::DeleteAbilityEffect(const unsigned _id)
{
LogSubmoduleRemoveStart("Ability", id, "effect", _id, name);
for (std::vector<AbilityEffect>::iterator i = effects.begin(); i != effects.end(); ++i)
diff --git a/pokemod/Ability.h b/pokemod/Ability.h
index 87f5a7a5..0e8f6af1 100644
--- a/pokemod/Ability.h
+++ b/pokemod/Ability.h
@@ -26,7 +26,6 @@
#define __POKEMOD_ABILITY__
#include <vector>
-#include <list>
#include "Object.h"
#include "String.h"
#include "AbilityEffect.h"
@@ -38,21 +37,21 @@ namespace PokeGen
class Ability : public Object
{
public:
- Ability(unsigned _id);
- Ability(Ini &ini, unsigned _id = UINT_MAX);
+ Ability(const unsigned _id);
+ Ability(Ini &ini, const unsigned _id = UINT_MAX);
~Ability();
- void ImportIni(Ini &ini, unsigned _id = UINT_MAX);
+ void ImportIni(Ini &ini, const unsigned _id = UINT_MAX);
void ExportIni(std::ofstream &fout) const;
void SetName(const String &n);
String GetName() const;
- AbilityEffect *GetAbilityEffect(unsigned _id);
+ AbilityEffect *GetAbilityEffect(const unsigned _id);
unsigned GetAbilityEffectCount() const;
void NewAbilityEffect(Ini *const ini = NULL);
- void DeleteAbilityEffect(unsigned _id);
+ void DeleteAbilityEffect(const unsigned _id);
private:
void Validate();
# ifdef PG_DEBUG_WINDOW
diff --git a/pokemod/AbilityEffect.cpp b/pokemod/AbilityEffect.cpp
index ee054010..0bc4988b 100644
--- a/pokemod/AbilityEffect.cpp
+++ b/pokemod/AbilityEffect.cpp
@@ -25,7 +25,7 @@
extern PokeGen::PokeMod::Pokemod curPokeMod;
-PokeGen::PokeMod::AbilityEffect::AbilityEffect(unsigned _id)
+PokeGen::PokeMod::AbilityEffect::AbilityEffect(const unsigned _id)
{
LogCtor("AbilityEffect", _id);
chance.Set(1, 1);
@@ -39,7 +39,7 @@ PokeGen::PokeMod::AbilityEffect::AbilityEffect(unsigned _id)
id = _id;
}
-PokeGen::PokeMod::AbilityEffect::AbilityEffect(Ini &ini, unsigned _id)
+PokeGen::PokeMod::AbilityEffect::AbilityEffect(Ini &ini, const unsigned _id)
{
LogCtorIni("AbilityEffect", _id);
ImportIni(ini, _id);
@@ -64,7 +64,7 @@ void PokeGen::PokeMod::AbilityEffect::Validate()
LogValidateOver("AbilityEffect", id, isValid);
}
-void PokeGen::PokeMod::AbilityEffect::ImportIni(Ini &ini, unsigned _id)
+void PokeGen::PokeMod::AbilityEffect::ImportIni(Ini &ini, const unsigned _id)
{
LogImportStart("AbilityEffect");
if (_id == UINT_MAX)
@@ -119,25 +119,25 @@ void PokeGen::PokeMod::AbilityEffect::SetChance(const Frac &c)
chance = c;
}
-void PokeGen::PokeMod::AbilityEffect::SetChance(unsigned n, unsigned d)
+void PokeGen::PokeMod::AbilityEffect::SetChance(const unsigned n, const unsigned d)
{
LogSetVar("AbilityEffect", id, "chance", n, d);
chance.Set(n, d);
}
-void PokeGen::PokeMod::AbilityEffect::SetChanceNum(unsigned n)
+void PokeGen::PokeMod::AbilityEffect::SetChanceNum(const unsigned n)
{
LogSetVar("AbilityEffect", id, "chance", n, true);
chance.SetNum(n);
}
-void PokeGen::PokeMod::AbilityEffect::SetChanceDenom(unsigned d)
+void PokeGen::PokeMod::AbilityEffect::SetChanceDenom(const unsigned d)
{
LogSetVar("AbilityEffect", id, "chance", d, false);
chance.SetDenom(d);
}
-void PokeGen::PokeMod::AbilityEffect::SetEffect(int e)
+void PokeGen::PokeMod::AbilityEffect::SetEffect(const int e)
{
if ((e <= AE_NONE) || (AE_END <= e))
LogOutOfRange("AbilityEffect", id, "effect", e, "");
@@ -157,7 +157,7 @@ void PokeGen::PokeMod::AbilityEffect::SetEffect(const String &e)
SetEffect(FindIn(AE_END, e, AbilityEffectStr));
}
-void PokeGen::PokeMod::AbilityEffect::SetVal1(int v1)
+void PokeGen::PokeMod::AbilityEffect::SetVal1(const int v1)
{
switch (effect)
{
@@ -283,7 +283,7 @@ void PokeGen::PokeMod::AbilityEffect::SetVal1(const String &v1)
}
}
-void PokeGen::PokeMod::AbilityEffect::SetVal2(int v2)
+void PokeGen::PokeMod::AbilityEffect::SetVal2(const int v2)
{
switch (effect)
{
@@ -373,7 +373,7 @@ void PokeGen::PokeMod::AbilityEffect::SetVal2(const String &v2)
}
}
-void PokeGen::PokeMod::AbilityEffect::SetVal3(int v3)
+void PokeGen::PokeMod::AbilityEffect::SetVal3(const int v3)
{
switch (effect)
{
@@ -414,7 +414,7 @@ void PokeGen::PokeMod::AbilityEffect::SetVal3(int v3)
}
}
-void PokeGen::PokeMod::AbilityEffect::SetTrigger(int t)
+void PokeGen::PokeMod::AbilityEffect::SetTrigger(const int t)
{
if ((t <= AT_NONE) || (AT_END <= t))
LogOutOfRange("AbilityEffect", id, "trigger", t, "");
@@ -432,7 +432,7 @@ void PokeGen::PokeMod::AbilityEffect::SetTrigger(const String &t)
SetTrigger(FindIn(AT_END, t, AbilityTriggerStr));
}
-void PokeGen::PokeMod::AbilityEffect::SetTval1(int tv1)
+void PokeGen::PokeMod::AbilityEffect::SetTval1(const int tv1)
{
switch (trigger)
{
@@ -544,7 +544,7 @@ void PokeGen::PokeMod::AbilityEffect::SetTval2(const Frac &tv2)
}
}
-void PokeGen::PokeMod::AbilityEffect::SetTval2(unsigned n, unsigned d)
+void PokeGen::PokeMod::AbilityEffect::SetTval2(const unsigned n, const unsigned d)
{
switch (trigger)
{
@@ -565,7 +565,7 @@ void PokeGen::PokeMod::AbilityEffect::SetTval2(unsigned n, unsigned d)
}
}
-void PokeGen::PokeMod::AbilityEffect::SetTval2Num(unsigned n)
+void PokeGen::PokeMod::AbilityEffect::SetTval2Num(const unsigned n)
{
switch (trigger)
{
@@ -586,7 +586,7 @@ void PokeGen::PokeMod::AbilityEffect::SetTval2Num(unsigned n)
}
}
-void PokeGen::PokeMod::AbilityEffect::SetTval2Denom(unsigned d)
+void PokeGen::PokeMod::AbilityEffect::SetTval2Denom(const unsigned d)
{
switch (trigger)
{
diff --git a/pokemod/AbilityEffect.h b/pokemod/AbilityEffect.h
index 2306b35e..6d93bba3 100644
--- a/pokemod/AbilityEffect.h
+++ b/pokemod/AbilityEffect.h
@@ -39,32 +39,32 @@ namespace PokeGen
class AbilityEffect : public Object
{
public:
- AbilityEffect(unsigned _id);
- AbilityEffect(Ini &xml, unsigned _id = UINT_MAX);
+ AbilityEffect(const unsigned _id);
+ AbilityEffect(Ini &ini, const unsigned _id = UINT_MAX);
~AbilityEffect();
- void ImportIni(Ini &xml, unsigned _id = UINT_MAX);
+ void ImportIni(Ini &ini, const unsigned _id = UINT_MAX);
void ExportIni(std::ofstream &fout, const String &ability) const;
void SetChance(const Frac &c);
- void SetChance(unsigned n, unsigned d);
- void SetChanceNum(unsigned n);
- void SetChanceDenom(unsigned d);
- void SetEffect(int e);
+ void SetChance(const unsigned n, const unsigned d);
+ void SetChanceNum(const unsigned n);
+ void SetChanceDenom(const unsigned d);
+ void SetEffect(const int e);
void SetEffect(const String &e);
- void SetVal1(int v1);
+ void SetVal1(const int v1);
void SetVal1(const String &v1);
- void SetVal2(int v2);
+ void SetVal2(const int v2);
void SetVal2(const String &v2);
- void SetVal3(int v3);
- void SetTrigger(int t);
+ void SetVal3(const int v3);
+ void SetTrigger(const int t);
void SetTrigger(const String &t);
- void SetTval1(int tv1);
+ void SetTval1(const int tv1);
void SetTval1(const String &tv1);
void SetTval2(const Frac &tv2);
- void SetTval2(unsigned n, unsigned d);
- void SetTval2Num(unsigned n);
- void SetTval2Denom(unsigned d);
+ void SetTval2(const unsigned n, const unsigned d);
+ void SetTval2Num(const unsigned n);
+ void SetTval2Denom(const unsigned d);
Frac GetChance() const;
unsigned GetChanceNum() const;
diff --git a/pokemod/Author.cpp b/pokemod/Author.cpp
index b290dc49..3d71a25d 100644
--- a/pokemod/Author.cpp
+++ b/pokemod/Author.cpp
@@ -23,7 +23,7 @@
#include "Author.h"
-PokeGen::PokeMod::Author::Author(unsigned _id)
+PokeGen::PokeMod::Author::Author(const unsigned _id)
{
LogCtor("Author", id);
name = "";
@@ -32,7 +32,7 @@ PokeGen::PokeMod::Author::Author(unsigned _id)
id = _id;
}
-PokeGen::PokeMod::Author::Author(Ini &ini, unsigned _id)
+PokeGen::PokeMod::Author::Author(Ini &ini, const unsigned _id)
{
LogCtorIni("Author", id);
ImportIni(ini, _id);
@@ -103,7 +103,7 @@ void PokeGen::PokeMod::Author::Validate(const wxListBox &output)
}
#endif
-void PokeGen::PokeMod::Author::ImportIni(Ini &ini, unsigned _id)
+void PokeGen::PokeMod::Author::ImportIni(Ini &ini, const unsigned _id)
{
LogImportStart("Author");
String curName;
diff --git a/pokemod/Author.h b/pokemod/Author.h
index f4e29814..33ebb39e 100644
--- a/pokemod/Author.h
+++ b/pokemod/Author.h
@@ -34,11 +34,11 @@ namespace PokeGen
class Author : public Object
{
public:
- Author(unsigned _id);
- Author(Ini &ini, unsigned _id = UINT_MAX);
+ Author(const unsigned _id);
+ Author(Ini &ini, const unsigned _id = UINT_MAX);
~Author();
- void ImportIni(Ini &ini, unsigned _id = UINT_MAX);
+ void ImportIni(Ini &ini, const unsigned _id = UINT_MAX);
void ExportIni(std::ofstream &fout) const;
void SetName(const String &n);
diff --git a/pokemod/Badge.cpp b/pokemod/Badge.cpp
index f900e24b..a49385c1 100644
--- a/pokemod/Badge.cpp
+++ b/pokemod/Badge.cpp
@@ -26,7 +26,7 @@
extern PokeGen::PokeMod::Pokemod curPokeMod;
-PokeGen::PokeMod::Badge::Badge(unsigned _id)
+PokeGen::PokeMod::Badge::Badge(const unsigned _id)
{
LogCtor("Badge", _id);
name = "";
@@ -40,7 +40,7 @@ PokeGen::PokeMod::Badge::Badge(unsigned _id)
id = _id;
}
-PokeGen::PokeMod::Badge::Badge(Ini &ini, unsigned _id)
+PokeGen::PokeMod::Badge::Badge(Ini &ini, const unsigned _id)
{
LogCtorIni("Badge", _id);
ImportIni(ini, _id);
@@ -124,7 +124,7 @@ void PokeGen::PokeMod::Badge::Validate(const wxListBox &output)
}
#endif
-void PokeGen::PokeMod::Badge::ImportIni(Ini &ini, unsigned _id)
+void PokeGen::PokeMod::Badge::ImportIni(Ini &ini, const unsigned _id)
{
LogImportStart("Badge");
if (_id == UINT_MAX)
@@ -191,31 +191,31 @@ void PokeGen::PokeMod::Badge::SetBadge(const Path &b)
badge = b;
}
-void PokeGen::PokeMod::Badge::SetObey(unsigned o)
+void PokeGen::PokeMod::Badge::SetObey(const unsigned o)
{
LogSetVar("Badge", id, "obey", o);
obey = o;
}
-void PokeGen::PokeMod::Badge::SetStat(unsigned s, unsigned n, unsigned d)
+void PokeGen::PokeMod::Badge::SetStat(const unsigned s, const unsigned n, const unsigned d)
{
LogSetVar("Badge", id, String("stats[%u]", s), Frac(n, d, true));
stats[s].Set(n, d);
}
-void PokeGen::PokeMod::Badge::SetStatNum(unsigned s, unsigned n)
+void PokeGen::PokeMod::Badge::SetStatNum(const unsigned s, const unsigned n)
{
LogSetVar("Badge", id, String("stat[%u] numerator", s), n);
stats[s].SetNum(n);
}
-void PokeGen::PokeMod::Badge::SetStatDenom(unsigned s, unsigned d)
+void PokeGen::PokeMod::Badge::SetStatDenom(const unsigned s, const unsigned d)
{
LogSetVar("Badge", id, String("stat[%u] denominator", s), d);
stats[s].SetDenom(d);
}
-void PokeGen::PokeMod::Badge::SetHm(unsigned h, bool hb)
+void PokeGen::PokeMod::Badge::SetHm(const unsigned h, const bool hb)
{
LogSetVar("Badge", id, String("hm[%u]", h), hb);
if (HM_END <= h)
@@ -248,7 +248,7 @@ unsigned PokeGen::PokeMod::Badge::GetObey() const
return obey;
}
-PokeGen::PokeMod::Frac PokeGen::PokeMod::Badge::GetStat(unsigned s) const
+PokeGen::PokeMod::Frac PokeGen::PokeMod::Badge::GetStat(const unsigned s) const
{
LogFetchVar("Badge", id, String("stats[%u]", s), stats[s].GetNum(), stats[s].GetDenom());
if ((curPokeMod.IsSpecialSplit() ? STH_END_RBY : STH_END_GSC) <= s)
@@ -256,7 +256,7 @@ PokeGen::PokeMod::Frac PokeGen::PokeMod::Badge::GetStat(unsigned s) const
return stats[s];
}
-bool PokeGen::PokeMod::Badge::GetHm(unsigned h) const
+bool PokeGen::PokeMod::Badge::GetHm(const unsigned h) const
{
LogFetchVar("Badge", id, String("hm[%u]", h), hm[h]);
if (HM_END <= h)
diff --git a/pokemod/Badge.h b/pokemod/Badge.h
index 6606b45c..c28bc864 100644
--- a/pokemod/Badge.h
+++ b/pokemod/Badge.h
@@ -39,28 +39,28 @@ namespace PokeGen
class Badge : public Object
{
public:
- Badge(unsigned _id);
- Badge(Ini &ini, unsigned _id = UINT_MAX);
+ Badge(const unsigned _id);
+ Badge(Ini &ini, const unsigned _id = UINT_MAX);
~Badge();
- void ImportIni(Ini &ini, unsigned _id = UINT_MAX);
+ void ImportIni(Ini &ini, const unsigned _id = UINT_MAX);
void ExportIni(std::ofstream &fout) const;
void SetName(const String &n);
void SetFace(const Path &f);
void SetBadge(const Path &b);
- void SetObey(unsigned o);
- void SetStat(unsigned s, unsigned n, unsigned d);
- void SetStatNum(unsigned s, unsigned n);
- void SetStatDenom(unsigned s, unsigned d);
- void SetHm(unsigned h, bool hb);
+ void SetObey(const unsigned o);
+ void SetStat(const unsigned s, const unsigned n, const unsigned d);
+ void SetStatNum(const unsigned s, const unsigned n);
+ void SetStatDenom(const unsigned s, const unsigned d);
+ void SetHm(const unsigned h, const bool hb);
String GetName() const;
Path GetFace() const;
Path GetBadge() const;
unsigned GetObey() const;
- Frac GetStat(unsigned s) const;
- bool GetHm(unsigned h) const;
+ Frac GetStat(const unsigned s) const;
+ bool GetHm(const unsigned h) const;
private:
void Validate();
# ifdef PG_DEBUG_WINDOW
diff --git a/pokemod/CoinItem.cpp b/pokemod/CoinItem.cpp
index c04582ce..77aed82c 100644
--- a/pokemod/CoinItem.cpp
+++ b/pokemod/CoinItem.cpp
@@ -25,7 +25,7 @@
extern PokeGen::PokeMod::Pokemod curPokeMod;
-PokeGen::PokeMod::CoinItem::CoinItem(unsigned _id)
+PokeGen::PokeMod::CoinItem::CoinItem(const unsigned _id)
{
LogCtor("CoinItem", _id);
type = 0;
@@ -35,7 +35,7 @@ PokeGen::PokeMod::CoinItem::CoinItem(unsigned _id)
id = _id;
}
-PokeGen::PokeMod::CoinItem::CoinItem(Ini &ini, unsigned _id)
+PokeGen::PokeMod::CoinItem::CoinItem(Ini &ini, const unsigned _id)
{
LogCtorIni("CoinItem", _id);
ImportIni(ini, _id);
@@ -120,7 +120,7 @@ void PokeGen::PokeMod::CoinItem::Validate(const wxListBox &output)
}
#endif
-void PokeGen::PokeMod::CoinItem::ImportIni(Ini &ini, unsigned _id)
+void PokeGen::PokeMod::CoinItem::ImportIni(Ini &ini, const unsigned _id)
{
LogImportStart("CoinItem");
if (_id == UINT_MAX)
@@ -153,7 +153,7 @@ void PokeGen::PokeMod::CoinItem::ExportIni(std::ofstream &fout, const String &co
LogExportOver("CoinItem", id, name);
}
-void PokeGen::PokeMod::CoinItem::SetType(unsigned t)
+void PokeGen::PokeMod::CoinItem::SetType(const unsigned t)
{
LogSetVar("CoinItem", id, "type", t);
if (t < CIT_END)
@@ -163,7 +163,7 @@ void PokeGen::PokeMod::CoinItem::SetType(unsigned t)
}
}
-void PokeGen::PokeMod::CoinItem::SetObject(int o)
+void PokeGen::PokeMod::CoinItem::SetObject(const int o)
{
LogSetVar("CoinItem", id, "object", o);
if (((type == CIT_ITEM) && curPokeMod.GetItem(o)) || ((type == CIT_POKEMON) && curPokeMod.GetPokemon(o)))
@@ -179,14 +179,14 @@ void PokeGen::PokeMod::CoinItem::SetObject(const String &o)
object = p->GetId();
}
-void PokeGen::PokeMod::CoinItem::SetAmount(unsigned a)
+void PokeGen::PokeMod::CoinItem::SetAmount(const unsigned a)
{
LogSetVar("CoinItem", id, "amount", a);
if (a)
amount = a;
}
-void PokeGen::PokeMod::CoinItem::SetCost(unsigned c)
+void PokeGen::PokeMod::CoinItem::SetCost(const unsigned c)
{
LogSetVar("CoinItem", id, "cost", c);
cost = c;
diff --git a/pokemod/CoinItem.h b/pokemod/CoinItem.h
index 641c15fa..93108242 100644
--- a/pokemod/CoinItem.h
+++ b/pokemod/CoinItem.h
@@ -35,18 +35,18 @@ namespace PokeGen
class CoinItem : public Object
{
public:
- CoinItem(unsigned _id);
- CoinItem(Ini &ini, unsigned _id = UINT_MAX);
+ CoinItem(const unsigned _id);
+ CoinItem(Ini &ini, const unsigned _id = UINT_MAX);
~CoinItem();
- void ImportIni(Ini &ini, unsigned _id = UINT_MAX);
+ void ImportIni(Ini &ini, const unsigned _id = UINT_MAX);
void ExportIni(std::ofstream &fout, const String &coinList) const;
- void SetType(unsigned t);
- void SetObject(int o);
+ void SetType(const unsigned t);
+ void SetObject(const int o);
void SetObject(const String &o);
- void SetAmount(unsigned a);
- void SetCost(unsigned c);
+ void SetAmount(const unsigned a);
+ void SetCost(const unsigned c);
unsigned GetType() const;
int GetObject() const;
diff --git a/pokemod/CoinList.cpp b/pokemod/CoinList.cpp
index 175daf39..ce675e66 100644
--- a/pokemod/CoinList.cpp
+++ b/pokemod/CoinList.cpp
@@ -26,7 +26,7 @@
extern PokeGen::PokeMod::Pokemod curPokeMod;
-PokeGen::PokeMod::CoinList::CoinList(unsigned _id)
+PokeGen::PokeMod::CoinList::CoinList(const unsigned _id)
{
LogCtor("CoinList", _id);
name = "";
@@ -35,7 +35,7 @@ PokeGen::PokeMod::CoinList::CoinList(unsigned _id)
id = _id;
}
-PokeGen::PokeMod::CoinList::CoinList(Ini &ini, unsigned _id)
+PokeGen::PokeMod::CoinList::CoinList(Ini &ini, const unsigned _id)
{
LogCtorIni("CoinList", _id);
ImportIni(ini, _id);
@@ -104,7 +104,7 @@ void PokeGen::PokeMod::CoinList::Validate(const wxListBox &output)
}
#endif
-void PokeGen::PokeMod::CoinList::ImportIni(Ini &ini, unsigned _id)
+void PokeGen::PokeMod::CoinList::ImportIni(Ini &ini, const unsigned _id)
{
LogImportStart("CoinList");
if (_id == UINT_MAX)
@@ -142,7 +142,7 @@ void PokeGen::PokeMod::CoinList::SetName(const String &n)
name = n;
}
-void PokeGen::PokeMod::CoinList::SetValue(unsigned v)
+void PokeGen::PokeMod::CoinList::SetValue(const unsigned v)
{
LogSetVar("CoinList", id, "value", value, name);
value = v;
@@ -160,7 +160,7 @@ unsigned PokeGen::PokeMod::CoinList::GetValue() const
return value;
}
-PokeGen::PokeMod::CoinItem *PokeGen::PokeMod::CoinList::GetCoinItem(unsigned _id)
+PokeGen::PokeMod::CoinItem *PokeGen::PokeMod::CoinList::GetCoinItem(const unsigned _id)
{
LogSubmoduleFetch("CoinList", id, "item", _id, name);
for (unsigned i = 0; i < GetAbilityEffectCount(); ++i)
@@ -194,7 +194,7 @@ void PokeGen::PokeMod::CoinList::NewCoinItem(Ini *const ini)
items.push_back(newCoinItem);
}
-void PokeGen::PokeMod::CoinList::DeleteCoinItem(unsigned _id)
+void PokeGen::PokeMod::CoinList::DeleteCoinItem(const unsigned _id)
{
LogSubmoduleRemoveStart("CoinList", id, "item", _id, name);
for (std::vector<AbilityEffect>::iterator i = items.begin(); i != items.end(); ++i)
diff --git a/pokemod/CoinList.h b/pokemod/CoinList.h
index 0b5f3aef..dc5aa33a 100644
--- a/pokemod/CoinList.h
+++ b/pokemod/CoinList.h
@@ -38,23 +38,23 @@ namespace PokeGen
class CoinList : public Object
{
public:
- CoinList(unsigned _id);
- CoinList(Ini &ini, unsigned _id = UINT_MAX);
+ CoinList(const unsigned _id);
+ CoinList(Ini &ini, const unsigned _id = UINT_MAX);
~CoinList();
- void ImportIni(Ini &ini, unsigned _id = UINT_MAX);
+ void ImportIni(Ini &ini, const unsigned _id = UINT_MAX);
void ExportIni(std::ofstream &fout);
void SetName(const String &n);
- void SetValue(unsigned v);
+ void SetValue(const unsigned v);
String GetName() const;
unsigned GetValue() const;
- CoinItem *GetCoinItem(unsigned _id);
+ CoinItem *GetCoinItem(const unsigned _id);
unsigned GetCoinItemCount() const;
void NewCoinItem(Ini *const ini);
- void DeleteCoinItem(unsigned _id);
+ void DeleteCoinItem(const unsigned _id);
private:
void Validate();
# ifdef PG_DEBUG_WINDOW
diff --git a/pokemod/Dialog.cpp b/pokemod/Dialog.cpp
index 8e62e368..9dce1dff 100644
--- a/pokemod/Dialog.cpp
+++ b/pokemod/Dialog.cpp
@@ -25,14 +25,14 @@
extern PokeGen::PokeMod::Pokemod curPokeMod;
-PokeGen::PokeMod::Dialog::Dialog(unsigned _id)
+PokeGen::PokeMod::Dialog::Dialog(const unsigned _id)
{
LogCtor("Dialog", _id);
dialog = "";
id = _id;
}
-PokeGen::PokeMod::Dialog::Dialog(Ini &ini, unsigned _id)
+PokeGen::PokeMod::Dialog::Dialog(Ini &ini, const unsigned _id)
{
LogCtorIni("Dialog", _id);
ImportIni(ini, _id);
@@ -57,7 +57,7 @@ void PokeGen::PokeMod::Dialog::Validate()
LogValidateOver("Dialog", id, isValid);
}
-void PokeGen::PokeMod::Dialog::ImportIni(Ini &ini, unsigned _id)
+void PokeGen::PokeMod::Dialog::ImportIni(Ini &ini, const unsigned _id)
{
LogImportStart("Dialog");
if (_id == UINT_MAX)
@@ -96,12 +96,12 @@ PokeGen::PokeMod::String PokeGen::PokeMod::Dialog::GetDialog() const
return dialog;
}
-void PokeGen::PokeMod::Dialog::InsertDialogCommand(unsigned cmd, unsigned pos)
+void PokeGen::PokeMod::Dialog::InsertDialogCommand(const unsigned cmd, const unsigned pos)
{
// TODO (Ben#1#): Dialog commands
}
-void PokeGen::PokeMod::Dialog::InsertDialogCommand(const String &cmd, unsigned pos)
+void PokeGen::PokeMod::Dialog::InsertDialogCommand(const String &cmd, const unsigned pos)
{
// TODO (Ben#1#): Dialog commands
}
diff --git a/pokemod/Dialog.h b/pokemod/Dialog.h
index 858055de..2e2a54e3 100644
--- a/pokemod/Dialog.h
+++ b/pokemod/Dialog.h
@@ -35,19 +35,19 @@ namespace PokeGen
class Dialog : public Object
{
public:
- Dialog(unsigned _id);
- Dialog(Ini &ini, unsigned _id = UINT_MAX);
+ Dialog(const unsigned _id);
+ Dialog(Ini &ini, const unsigned _id = UINT_MAX);
~Dialog();
- void ImportIni(Ini &ini, unsigned _id = UINT_MAX);
+ void ImportIni(Ini &ini, const unsigned _id = UINT_MAX);
void ExportIni(std::ofstream &fout) const;
void SetDialog(const String &d);
String GetDialog() const;
- void InsertDialogCommand(unsigned cmd, unsigned pos);
- void InsertDialogCommand(const String &cmd, unsigned pos);
+ void InsertDialogCommand(const unsigned cmd, const unsigned pos);
+ void InsertDialogCommand(const String &cmd, const unsigned pos);
private:
void Validate();
# ifdef PG_DEBUG_WINDOW
diff --git a/pokemod/EggGroup.cpp b/pokemod/EggGroup.cpp
new file mode 100644
index 00000000..6c75ba59
--- /dev/null
+++ b/pokemod/EggGroup.cpp
@@ -0,0 +1,110 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name: pokemod/EggGroup.cpp
+// Purpose: Define a type for a Pokémon
+// Author: Ben Boeckel
+// Modified by: Ben Boeckel
+// Created: Tue Mar 20 18:05:05 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 "EggGroup.h"
+
+PokeGen::PokeMod::EggGroup::EggGroup(const unsigned _id)
+{
+ LogCtor("EggGroup", _id);
+ name = "";
+ id = _id;
+}
+
+PokeGen::PokeMod::EggGroup::EggGroup(Ini &ini, const unsigned _id)
+{
+ LogCtorIni("EggGroup", _id);
+ ImportIni(ini, _id);
+ if (id == UINT_MAX)
+ LogIdError("EggGroup");
+}
+
+PokeGen::PokeMod::EggGroup::~EggGroup()
+{
+ LogDtor("EggGroup", id, name);
+}
+
+void PokeGen::PokeMod::Type::Validate()
+{
+ isValid = true;
+ LogValidateStart("EggGroup", id, name);
+ if (name == "")
+ {
+ LogVarNotSet("EggGroup", id, "name", name);
+ isValid = false;
+ }
+ LogValidateOver("EggGroup", id, isValid, name);
+}
+
+#ifdef PG_DEBUG_WINDOW
+void PokeGen::PokeMod::Type::Validate(const wxListBox &output)
+{
+ isValid = true;
+ LogValidateStart("EggGroup", id, name);
+ if (name == "")
+ {
+ LogVarNotSet("EggGroup", id, "name", name);
+ output.Append(ConsoleLogVarNotSet("EggGroup", id, "name", name));
+ isValid = false;
+ }
+ LogValidateOver("EggGroup", id, isValid, name);
+}
+#endif
+
+void PokeGen::PokeMod::EggGroup::ImportIni(Ini &ini, const unsigned _id)
+{
+ LogImportStart("EggGroup");
+ String curName;
+ if (_id == UINT_MAX)
+ {
+ ini.GetValue("id", id, UINT_MAX);
+ if (id == UINT_MAX)
+ LogIdNotFound("EggGroup");
+ }
+ else
+ id = _id;
+ ini.GetValue("name", name, "");
+ LogImportOver("EggGroup", id, name);
+}
+
+void PokeGen::PokeMod::EggGroup::ExportIni(std::ofstream &fout) const
+{
+ LogExportStart("EggGroup", id, name);
+ // Declare the elements
+ Ini exType("eggGroup");
+ exType.AddField("id", id);
+ exType.AddField("name", name);
+ exType.Export(fout);
+ LogExportOver("EggGroup", id, name);
+}
+
+void PokeGen::PokeMod::EggGroup::SetName(const String &n)
+{
+ LogSetVar("EggGroup", id, "name", n, name);
+ name = n;
+}
+
+PokeGen::PokeMod::String PokeGen::PokeMod::EggGroup::GetName() const
+{
+ LogFetchVar("EggGroup", id, "name", name, name);
+ return name;
+}
diff --git a/pokemod/EggGroup.h b/pokemod/EggGroup.h
new file mode 100644
index 00000000..cde1846c
--- /dev/null
+++ b/pokemod/EggGroup.h
@@ -0,0 +1,58 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name: pokemod/EggGroup.h
+// Purpose: Define an egg group a Pokémon can belong to
+// Author: Ben Boeckel
+// Modified by: Ben Boeckel
+// Created: Tue Mar 20 18:05:05 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_EGGGROUP__
+#define __POKEMOD_EGGGROUP__
+
+#include "Object.h"
+#include "String.h"
+
+namespace PokeGen
+{
+ namespace PokeMod
+ {
+ class EggGroup : public Object
+ {
+ public:
+ EggGroup(const unsigned _id);
+ EggGroup(Ini &ini, const unsigned _id = UINT_MAX);
+ ~EggGroup();
+
+ void ImportIni(Ini &ini, const unsigned _id = UINT_MAX);
+ void ExportIni(std::ofstream &fout) const;
+
+ void SetName(const String &n);
+
+ String GetName() const;
+ private:
+ void Validate();
+# ifdef PG_DEBUG_WINDOW
+ void Validate(const wxListBox &output);
+# endif
+
+ String name;
+ };
+ }
+}
+
+#endif
diff --git a/pokemod/Flag.cpp b/pokemod/Flag.cpp
index cb655102..b9d87063 100644
--- a/pokemod/Flag.cpp
+++ b/pokemod/Flag.cpp
@@ -23,7 +23,7 @@
#include "Flag.h"
-PokeGen::PokeMod::Flag::Flag(unsigned f, int s)
+PokeGen::PokeMod::Flag::Flag(const unsigned f, const int s)
{
Log("Flag: Initializing", PM_DEBUG_DEBUG);
flag = f;
@@ -49,13 +49,13 @@ void PokeGen::PokeMod::Flag::ExportIni(std::ofstream &fout, const String &val) c
Log(String("Flag Export: Finished %s", val.c_str()), PM_DEBUG_INFO);
}
-void PokeGen::PokeMod::Flag::SetFlag(unsigned f)
+void PokeGen::PokeMod::Flag::SetFlag(const unsigned f)
{
Log(String("Flag: Setting the flag to (%u)", f), PM_DEBUG_DEBUG);
flag = f;
}
-void PokeGen::PokeMod::Flag::SetStatus(int s)
+void PokeGen::PokeMod::Flag::SetStatus(const int s)
{
Log(String("Flag: Setting the status to (%d)", s), PM_DEBUG_DEBUG);
// Avoid errors
diff --git a/pokemod/Flag.h b/pokemod/Flag.h
index 15918de5..8f937f5d 100644
--- a/pokemod/Flag.h
+++ b/pokemod/Flag.h
@@ -35,13 +35,13 @@ namespace PokeGen
class Flag
{
public:
- Flag(unsigned f, int s);
+ Flag(const unsigned f, const int s);
void ImportIni(Ini &ini);
void ExportIni(std::ofstream &fout, const String &val) const;
- void SetFlag(unsigned f);
- void SetStatus(int s);
+ void SetFlag(const unsigned f);
+ void SetStatus(const int s);
void SetStatus(const String &s);
unsigned GetFlag() const;
diff --git a/pokemod/Frac.cpp b/pokemod/Frac.cpp
index 1ce7be90..0553a534 100644
--- a/pokemod/Frac.cpp
+++ b/pokemod/Frac.cpp
@@ -23,7 +23,7 @@
#include "Frac.h"
-PokeGen::PokeMod::Frac::Frac(bool i)
+PokeGen::PokeMod::Frac::Frac(const bool i)
{
Log("Frac: Initializing", PM_DEBUG_DEBUG);
num = 1;
@@ -31,7 +31,7 @@ PokeGen::PokeMod::Frac::Frac(bool i)
improper = i;
}
-PokeGen::PokeMod::Frac::Frac(unsigned n, unsigned d, bool i)
+PokeGen::PokeMod::Frac::Frac(const unsigned n, const unsigned d, const bool i)
{
Log(String("Frac: Initializing as %u/%u (%u)", n, d, i), PM_DEBUG_DEBUG);
Set(n, d, i);
@@ -60,7 +60,7 @@ void PokeGen::PokeMod::Frac::ExportIni(std::ofstream &fout, const String &val)
Log(String("Frac Export: Finished %u/%u as %s", num, denom, val.c_str()), PM_DEBUG_INFO);
}
-void PokeGen::PokeMod::Frac::Set(unsigned n, unsigned d)
+void PokeGen::PokeMod::Frac::Set(const unsigned n, const unsigned d)
{
Log(String("Frac: Setting to %u/%u", n, d), PM_DEBUG_DEBUG);
SetDenom(d);
@@ -68,13 +68,13 @@ void PokeGen::PokeMod::Frac::Set(unsigned n, unsigned d)
Reduce();
}
-void PokeGen::PokeMod::Frac::Set(unsigned n, unsigned d, bool i)
+void PokeGen::PokeMod::Frac::Set(const unsigned n, const unsigned d, const bool i)
{
SetImproper(i);
Set(n, d);
}
-void PokeGen::PokeMod::Frac::SetNum(unsigned n)
+void PokeGen::PokeMod::Frac::SetNum(const unsigned n)
{
// Make sure the numerator is less than the denominator if proper
if ((n <= denom) || improper)
@@ -86,7 +86,7 @@ void PokeGen::PokeMod::Frac::SetNum(unsigned n)
Log(String("Frac: Setting tried to set numerator to %u when denominator is %u", n, denom), PM_DEBUG_DEBUG);
}
-void PokeGen::PokeMod::Frac::SetDenom(unsigned d)
+void PokeGen::PokeMod::Frac::SetDenom(const unsigned d)
{
// Make sure the denominator isn't 0
if (d)
@@ -104,7 +104,7 @@ void PokeGen::PokeMod::Frac::SetDenom(unsigned d)
}
}
-void PokeGen::PokeMod::Frac::SetImproper(bool i)
+void PokeGen::PokeMod::Frac::SetImproper(const bool i)
{
Log(String("Frac: Setting as %s", i ? "improper" : "proper"), PM_DEBUG_DEBUG);
improper = i;
diff --git a/pokemod/Frac.h b/pokemod/Frac.h
index 1fe46ff6..ace4a4ba 100644
--- a/pokemod/Frac.h
+++ b/pokemod/Frac.h
@@ -34,17 +34,17 @@ namespace PokeGen
class Frac
{
public:
- Frac(bool i = false);
- Frac(unsigned n, unsigned d, bool i = false);
+ Frac(const bool i = false);
+ Frac(const unsigned n, const unsigned d, const bool i = false);
void ImportIni(Ini &ini);
void ExportIni(std::ofstream &fout, const String &val);
- void Set(unsigned n, unsigned d);
- void Set(unsigned n, unsigned d, bool i);
- void SetNum(unsigned n);
- void SetDenom(unsigned d);
- void SetImproper(bool i);
+ void Set(const unsigned n, const unsigned d);
+ void Set(const unsigned n, const unsigned d, const bool i);
+ void SetNum(const unsigned n);
+ void SetDenom(const unsigned d);
+ void SetImproper(const bool i);
unsigned GetNum() const;
unsigned GetDenom() const;
diff --git a/pokemod/Ini.cpp b/pokemod/Ini.cpp
index 4b3d9eb6..3a5d0c88 100644
--- a/pokemod/Ini.cpp
+++ b/pokemod/Ini.cpp
@@ -82,7 +82,7 @@ PokeGen::PokeMod::String PokeGen::PokeMod::Ini::GetName() const
return name;
}
-void PokeGen::PokeMod::Ini::GetValue(const String &field, int &val, int def)
+void PokeGen::PokeMod::Ini::GetValue(const String &field, int &val, const int def)
{
if (!fields.count(field))
{
@@ -95,7 +95,7 @@ void PokeGen::PokeMod::Ini::GetValue(const String &field, int &val, int def)
val = ((temp < INT_MIN) || (INT_MAX < temp) || *end) ? def : temp;
}
-void PokeGen::PokeMod::Ini::GetValue(const String &field, unsigned &val, unsigned def)
+void PokeGen::PokeMod::Ini::GetValue(const String &field, unsigned &val, const unsigned def)
{
if (!fields.count(field))
{
@@ -118,7 +118,7 @@ void PokeGen::PokeMod::Ini::GetValue(const String &field, String &val, const Str
val = fields[field];
}
-void PokeGen::PokeMod::Ini::GetValue(const String &field, bool &val, bool def)
+void PokeGen::PokeMod::Ini::GetValue(const String &field, bool &val, const bool def)
{
if (!fields.count(field))
{
@@ -133,7 +133,7 @@ void PokeGen::PokeMod::Ini::GetValue(const String &field, bool &val, bool def)
val = def;
}
-void PokeGen::PokeMod::Ini::GetValue(const String &field, double &val, double def)
+void PokeGen::PokeMod::Ini::GetValue(const String &field, double &val, const double def)
{
if (!fields.count(field))
{
diff --git a/pokemod/Ini.h b/pokemod/Ini.h
index b37ed3b8..bb29c4d6 100644
--- a/pokemod/Ini.h
+++ b/pokemod/Ini.h
@@ -49,11 +49,11 @@ namespace PokeGen
void AddField(const String &n, const double v);
String GetName() const;
- void GetValue(const String &field, int &val, int def = -1);
- void GetValue(const String &field, unsigned &val, unsigned def = UINT_MAX);
+ void GetValue(const String &field, int &val, const int def = -1);
+ void GetValue(const String &field, unsigned &val, const unsigned def = UINT_MAX);
void GetValue(const String &field, String &val, const String &def = "");
- void GetValue(const String &field, bool &val, bool def = true);
- void GetValue(const String &field, double &val, double def = 0);
+ void GetValue(const String &field, bool &val, const bool def = true);
+ void GetValue(const String &field, double &val, const double def = 0);
bool IsValid() const;
protected:
diff --git a/pokemod/Item.cpp b/pokemod/Item.cpp
index 40388447..b0d526a0 100644
--- a/pokemod/Item.cpp
+++ b/pokemod/Item.cpp
@@ -25,7 +25,7 @@
extern PokeGen::PokeMod::Pokemod curPokeMod;
-PokeGen::PokeMod::Item::Item(unsigned _id)
+PokeGen::PokeMod::Item::Item(const unsigned _id)
{
LogCtor("Item", _id);
name = "";
@@ -37,7 +37,7 @@ PokeGen::PokeMod::Item::Item(unsigned _id)
id = _id;
}
-PokeGen::PokeMod::Item::Item(Ini &ini, unsigned _id)
+PokeGen::PokeMod::Item::Item(Ini &ini, const unsigned _id)
{
LogCtorIni("Item", _id);
ImportIni(ini, _id);
@@ -120,7 +120,7 @@ void PokeGen::PokeMod::Item::Validate(const wxListBox &output)
}
#endif
-void PokeGen::PokeMod::Item::ImportIni(Ini &ini, unsigned _id)
+void PokeGen::PokeMod::Item::ImportIni(Ini &ini, const unsigned _id)
{
LogImportStart("Item");
if (_id == UINT_MAX)
@@ -164,13 +164,13 @@ void PokeGen::PokeMod::Item::SetName(const String &n)
name = n;
}
-void PokeGen::PokeMod::Item::SetSellable(bool s)
+void PokeGen::PokeMod::Item::SetSellable(const bool s)
{
LogSetVar("Item", id, "sellable", s, name);
sellable = s;
}
-void PokeGen::PokeMod::Item::SetType(int t)
+void PokeGen::PokeMod::Item::SetType(const int t)
{
LogSetVar("Item", id, "type", t, name);
if (curPokeMod.GetItemStorage(t))
@@ -184,7 +184,7 @@ void PokeGen::PokeMod::Item::SetType(const String &t)
type = i->GetId();
}
-void PokeGen::PokeMod::Item::SetPrice(unsigned p)
+void PokeGen::PokeMod::Item::SetPrice(const unsigned p)
{
LogSetVar("Item", id, "price", p, name);
price = p;
@@ -234,7 +234,7 @@ PokeGen::PokeMod::String PokeGen::PokeMod::Item::GetDescription() const
return description;
}
-PokeGen::PokeMod::ItemEffect *PokeGen::PokeMod::Item::GetItemEffect(unsigned _id)
+PokeGen::PokeMod::ItemEffect *PokeGen::PokeMod::Item::GetItemEffect(const unsigned _id)
{
LogSubmoduleFetch("Item", id, "effect", _id, name);
for (unsigned i = 0; i < GetItemEffectCount(); ++i)
@@ -252,7 +252,7 @@ unsigned PokeGen::PokeMod::Item::GetItemEffectCount() const
return effects.size();
}
-void PokeGen::PokeMod::Item::NewItemEffect()
+void PokeGen::PokeMod::Item::NewItemEffect(Ini *const ini)
{
unsigned i = 0;
// Find the first unused ID in the vector
@@ -268,7 +268,7 @@ void PokeGen::PokeMod::Item::NewItemEffect()
effects.push_back(newItemEffect);
}
-void PokeGen::PokeMod::Item::DeleteItemEffect(unsigned _id)
+void PokeGen::PokeMod::Item::DeleteItemEffect(const unsigned _id)
{
LogSubmoduleRemoveStart("Item", id, "effect", _id, name);
for (std::vector<ItemEffect>::iterator i = effects.begin(); i != effects.end(); ++i)
diff --git a/pokemod/Item.h b/pokemod/Item.h
index 2f83f842..bc20612c 100644
--- a/pokemod/Item.h
+++ b/pokemod/Item.h
@@ -37,18 +37,18 @@ namespace PokeGen
class Item : public Object
{
public:
- Item(unsigned _id);
- Item(Ini &ini, unsigned _id = UINT_MAX);
+ Item(const unsigned _id);
+ Item(Ini &ini, const unsigned _id = UINT_MAX);
~Item();
- void ImportIni(Ini &ini, unsigned _id = UINT_MAX);
+ void ImportIni(Ini &ini, const unsigned _id = UINT_MAX);
void ExportIni(std::ofstream &fout) const;
void SetName(const String &n);
- void SetSellable(bool s);
- void SetType(int t);
+ void SetSellable(const bool s);
+ void SetType(const int t);
void SetType(const String &t);
- void SetPrice(unsigned p);
+ void SetPrice(const unsigned p);
void SetDescription(const String &d);
String GetName() const;
@@ -58,10 +58,10 @@ namespace PokeGen
unsigned GetPrice() const;
String GetDescription() const;
- ItemEffect *GetItemEffect(unsigned _id);
+ ItemEffect *GetItemEffect(const unsigned _id);
unsigned GetItemEffectCount() const;
void NewItemEffect(Ini *const ini = NULL);
- void DeleteItemEffect(unsigned _id);
+ void DeleteItemEffect(const unsigned _id);
private:
void Validate();
# ifdef PG_DEBUG_WINDOW
diff --git a/pokemod/ItemEffect.cpp b/pokemod/ItemEffect.cpp
index 64f9a4d5..2192d56b 100644
--- a/pokemod/ItemEffect.cpp
+++ b/pokemod/ItemEffect.cpp
@@ -25,7 +25,7 @@
extern PokeGen::PokeMod::Pokemod curPokeMod;
-PokeGen::PokeMod::ItemEffect::ItemEffect(unsigned _id)
+PokeGen::PokeMod::ItemEffect::ItemEffect(const unsigned _id)
{
LogCtor("ItemEffect", _id);
overworld = false;
@@ -40,7 +40,7 @@ PokeGen::PokeMod::ItemEffect::ItemEffect(unsigned _id)
id = _id;
}
-PokeGen::PokeMod::ItemEffect::ItemEffect(Ini &xml, unsigned _id)
+PokeGen::PokeMod::ItemEffect::ItemEffect(Ini &ini, const unsigned _id)
{
LogCtorIni("ItemEffect", _id);
ImportIni(ini, _id);
@@ -65,7 +65,7 @@ void PokeGen::PokeMod::ItemEffect::Validate()
LogValidateOver("ItemEffect", id, isValid);
}
-void PokeGen::PokeMod::ItemEffect::ImportIni(Ini &ini, unsigned _id)
+void PokeGen::PokeMod::ItemEffect::ImportIni(Ini &ini, const unsigned _id)
{
LogImportStart("ItemEffect");
if (_id == UINT_MAX)
@@ -113,25 +113,25 @@ void PokeGen::PokeMod::ItemEffect::ExportIni(std::ofstream &fout, const String &
LogExportOver("ItemEffect", id);
}
-void PokeGen::PokeMod::ItemEffect::SetOverworld(bool o)
+void PokeGen::PokeMod::ItemEffect::SetOverworld(const bool o)
{
LogSetVar("ItemEffect", id, "overworld", o);
overworld = o;
}
-void PokeGen::PokeMod::ItemEffect::SetBattle(bool b)
+void PokeGen::PokeMod::ItemEffect::SetBattle(const bool b)
{
LogSetVar("ItemEffect", id, "battle", b);
battle = b;
}
-void PokeGen::PokeMod::ItemEffect::SetHeld(bool h)
+void PokeGen::PokeMod::ItemEffect::SetHeld(const bool h)
{
LogSetVar("ItemEffect", id, "held", h);
held = h;
}
-void PokeGen::PokeMod::ItemEffect::SetEffect(int e)
+void PokeGen::PokeMod::ItemEffect::SetEffect(const int e)
{
LogSetVar("ItemEffect", id, "effect", e);
if ((IE_NONE < e) && (e < IE_END))
@@ -160,7 +160,7 @@ void PokeGen::PokeMod::ItemEffect::SetEffect(const String &e)
}
// TODO (Ben#1#): Values code
-void PokeGen::PokeMod::ItemEffect::SetVal1(int v1)
+void PokeGen::PokeMod::ItemEffect::SetVal1(const int v1)
{
switch (effect)
{
@@ -243,7 +243,7 @@ void PokeGen::PokeMod::ItemEffect::SetVal1(int v1)
}
}
-void PokeGen::PokeMod::ItemEffect::SetVal2(int v2)
+void PokeGen::PokeMod::ItemEffect::SetVal2(const int v2)
{
switch (effect)
{
@@ -348,7 +348,7 @@ void PokeGen::PokeMod::ItemEffect::SetVal3(const PMFrac &v3)
}
}
-void PokeGen::PokeMod::ItemEffect::SetVal3(unsigned n, unsigned d)
+void PokeGen::PokeMod::ItemEffect::SetVal3(const unsigned n, const unsigned d)
{
switch (effect)
{
@@ -397,7 +397,7 @@ void PokeGen::PokeMod::ItemEffect::SetVal3(unsigned n, unsigned d)
}
}
-void PokeGen::PokeMod::ItemEffect::SetVal3Num(unsigned n)
+void PokeGen::PokeMod::ItemEffect::SetVal3Num(const unsigned n)
{
switch (effect)
{
@@ -446,7 +446,7 @@ void PokeGen::PokeMod::ItemEffect::SetVal3Num(unsigned n)
}
}
-void PokeGen::PokeMod::ItemEffect::SetVal3Denom(unsigned d)
+void PokeGen::PokeMod::ItemEffect::SetVal3Denom(const unsigned d)
{
switch (effect)
{
@@ -495,7 +495,7 @@ void PokeGen::PokeMod::ItemEffect::SetVal3Denom(unsigned d)
}
}
-void PokeGen::PokeMod::ItemEffect::SetVal4(int v4)
+void PokeGen::PokeMod::ItemEffect::SetVal4(const int v4)
{
switch (effect)
{
@@ -653,7 +653,7 @@ void PokeGen::PokeMod::ItemEffect::SetVal4(const PMString &v4)
}
}
-void PokeGen::PokeMod::ItemEffect::SetVal5(int v5)
+void PokeGen::PokeMod::ItemEffect::SetVal5(const int v5)
{
switch (effect)
{
@@ -745,73 +745,73 @@ void PokeGen::PokeMod::ItemEffect::SetVal5(const PMString &v5)
}
}
-bool PokeGen::PokeMod::ItemEffect::GetOverworld()
+bool PokeGen::PokeMod::ItemEffect::GetOverworld() const
{
PMLog("ItemEffect: Fetching overworld", PM_DEBUG_DEBUG);
return overworld;
}
-bool PokeGen::PokeMod::ItemEffect::GetBattle()
+bool PokeGen::PokeMod::ItemEffect::GetBattle() const
{
PMLog("ItemEffect: Fetching battle", PM_DEBUG_DEBUG);
return battle;
}
-bool PokeGen::PokeMod::ItemEffect::GetHeld()
+bool PokeGen::PokeMod::ItemEffect::GetHeld() const
{
PMLog("ItemEffect: Fetching held", PM_DEBUG_DEBUG);
return held;
}
-int PokeGen::PokeMod::ItemEffect::GetEffect()
+int PokeGen::PokeMod::ItemEffect::GetEffect() const
{
PMLog("ItemEffect: Fetching effect", PM_DEBUG_DEBUG);
return effect;
}
- PokeGen::PokeMod::ItemEffect::GetVal1()
+ PokeGen::PokeMod::ItemEffect::GetVal1() const
{
PMLog("ItemEffect: Fetching val1", PM_DEBUG_DEBUG);
return val1;
}
-int PokeGen::PokeMod::ItemEffect::GetVal2()
+int PokeGen::PokeMod::ItemEffect::GetVal2() const
{
PMLog("ItemEffect: Fetching val2", PM_DEBUG_DEBUG);
return val2;
}
-int PokeGen::PokeMod::ItemEffect::GetVal3()
+int PokeGen::PokeMod::ItemEffect::GetVal3() const
{
PMLog("ItemEffect: Fetching val3", PM_DEBUG_DEBUG);
return val3;
}
-PokeGen::PokeMod::PMString PokeGen::PokeMod::ItemEffect::GetVal3String()
+PokeGen::PokeMod::PMString PokeGen::PokeMod::ItemEffect::GetVal3String() const
{
PMLog("ItemEffect: Fetching val3", PM_DEBUG_DEBUG);
return val3;
}
-int PokeGen::PokeMod::ItemEffect::GetVal4()
+int PokeGen::PokeMod::ItemEffect::GetVal4() const
{
PMLog("ItemEffect: Fetching val4", PM_DEBUG_DEBUG);
return val4;
}
-PokeGen::PokeMod::PMString PokeGen::PokeMod::ItemEffect::GetVal4String()
+PokeGen::PokeMod::PMString PokeGen::PokeMod::ItemEffect::GetVal4String() const
{
PMLog("ItemEffect: Fetching val4", PM_DEBUG_DEBUG);
return val4;
}
-int PokeGen::PokeMod::ItemEffect::GetVal5()
+int PokeGen::PokeMod::ItemEffect::GetVal5() const
{
PMLog("ItemEffect: Fetching val5", PM_DEBUG_DEBUG);
return val5;
}
-PokeGen::PokeMod::PMString PokeGen::PokeMod::ItemEffect::GetVal5String()
+PokeGen::PokeMod::PMString PokeGen::PokeMod::ItemEffect::GetVal5String() const
{
PMLog("ItemEffect: Fetching val5", PM_DEBUG_DEBUG);
return val5;
diff --git a/pokemod/ItemEffect.h b/pokemod/ItemEffect.h
index 04e0b517..930f5e82 100644
--- a/pokemod/ItemEffect.h
+++ b/pokemod/ItemEffect.h
@@ -35,43 +35,43 @@ namespace PokeGen
class ItemEffect : public Object
{
public:
- ItemEffect(unsigned _id);
- ItemEffect(Ini &ini, unsigned _id = UINT_MAX);
+ ItemEffect(const unsigned _id);
+ ItemEffect(Ini &ini, const unsigned _id = UINT_MAX);
~ItemEffect();
- void ImportIni(Ini &ini, unsigned _id = UINT_MAX);
+ void ImportIni(Ini &ini, const unsigned _id = UINT_MAX);
void ExportIni(std::ofstream &fout, const String &item);
- void SetOverworld(bool o);
- void SetBattle(bool b);
- void SetHeld(bool h);
- void SetEffect(int e);
+ void SetOverworld(const bool o);
+ void SetBattle(const bool b);
+ void SetHeld(const bool h);
+ void SetEffect(const int e);
void SetEffect(const String &e);
- void SetVal1(int v1);
- void SetVal2(int v2);
+ void SetVal1(const int v1);
+ void SetVal2(const int v2);
void SetVal3(const Frac &v3);
- void SetVal3(unsigned n, unsigned d);
- void SetVal3Num(unsigned n);
- void SetVal3Denom(unsigned d);
- void SetVal4(int v4);
+ void SetVal3(const unsigned n, const unsigned d);
+ void SetVal3Num(const unsigned n);
+ void SetVal3Denom(const unsigned d);
+ void SetVal4(const int v4);
void SetVal4(const String &v4);
- void SetVal5(int v5);
+ void SetVal5(const int v5);
void SetVal5(const String &v5);
- bool GetOverworld();
- bool GetBattle();
- bool GetHeld();
- int GetEffect();
- int GetEffectString();
- int GetVal1();
- int GetVal2();
- Frac GetVal3();
- unsigned GetVal3Num();
- unsigned GetVal3Denom();
- int GetVal4();
- String GetVal4String();
- int GetVal5();
- String GetVal5String();
+ bool GetOverworld() const;
+ bool GetBattle() const;
+ bool GetHeld() const;
+ int GetEffect() const;
+ int GetEffectString() const;
+ int GetVal1() const;
+ int GetVal2() const;
+ Frac GetVal3() const;
+ unsigned GetVal3Num() const;
+ unsigned GetVal3Denom() const;
+ int GetVal4() const;
+ String GetVal4String() const;
+ int GetVal5() const;
+ String GetVal5String() const;
private:
void Validate();
# ifdef PG_DEBUG_WINDOW
diff --git a/pokemod/ItemStorage.cpp b/pokemod/ItemStorage.cpp
index 6901e677..3c73449a 100644
--- a/pokemod/ItemStorage.cpp
+++ b/pokemod/ItemStorage.cpp
@@ -23,7 +23,7 @@
#include "ItemStorage.h"
-PokeGen::PokeMod::ItemStorage::ItemStorage(unsigned _id)
+PokeGen::PokeMod::ItemStorage::ItemStorage(const unsigned _id)
{
LogCtor("ItemStorage", _id);
name = "";
@@ -32,7 +32,7 @@ PokeGen::PokeMod::ItemStorage::ItemStorage(unsigned _id)
id = _id;
}
-PokeGen::PokeMod::ItemStorage::ItemStorage(Ini &ini, unsigned _id)
+PokeGen::PokeMod::ItemStorage::ItemStorage(Ini &ini, const unsigned _id)
{
LogCtorIni("ItemStorage", _id);
ImportIni(ini, _id);
@@ -83,7 +83,7 @@ void PokeGen::PokeMod::ItemStorage::Validate(const wxListBox &output)
}
#endif
-void PokeGen::PokeMod::ItemStorage::ImportIni(Ini &ini, unsigned _id)
+void PokeGen::PokeMod::ItemStorage::ImportIni(Ini &ini, const unsigned _id)
{
LogImportStart("ItemStorage");
if (_id == UINT_MAX)
@@ -120,13 +120,13 @@ void PokeGen::PokeMod::ItemStorage::SetName(const String &n)
name = n;
}
-void PokeGen::PokeMod::ItemStorage::SetComputer(unsigned c)
+void PokeGen::PokeMod::ItemStorage::SetComputer(const unsigned c)
{
LogSetVar("ItemStorage", id, "computer", c, name);
computer = c;
}
-void PokeGen::PokeMod::ItemStorage::SetPlayer(unsigned p)
+void PokeGen::PokeMod::ItemStorage::SetPlayer(const unsigned p)
{
LogSetVar("ItemStorage", id, "player", p, name);
if (p)
diff --git a/pokemod/ItemStorage.h b/pokemod/ItemStorage.h
index 808cb602..7e785224 100644
--- a/pokemod/ItemStorage.h
+++ b/pokemod/ItemStorage.h
@@ -34,16 +34,16 @@ namespace PokeGen
class ItemStorage : public Object
{
public:
- ItemStorage(unsigned _id);
- ItemStorage(Ini &ini, unsigned _id = UINT_MAX);
+ ItemStorage(const unsigned _id);
+ ItemStorage(Ini &ini, const unsigned _id = UINT_MAX);
~ItemStorage();
- void ImportIni(Ini &ini, unsigned _id = UINT_MAX);
+ void ImportIni(Ini &ini, const unsigned _id = UINT_MAX);
void ExportIni(std::ofstream &fout) const;
void SetName(const String &n);
- void SetComputer(unsigned c);
- void SetPlayer(unsigned p);
+ void SetComputer(const unsigned c);
+ void SetPlayer(const unsigned p);
String GetName() const;
unsigned GetComputer() const;
diff --git a/pokemod/MapTrainerTeam.cpp b/pokemod/MapTrainerTeam.cpp
index 5fc6c3e5..f9b3e781 100644
--- a/pokemod/MapTrainerTeam.cpp
+++ b/pokemod/MapTrainerTeam.cpp
@@ -25,7 +25,7 @@
extern PokeGen::PokeMod::Pokemod curPokeMod;
-PokeGen::PokeMod::MapTrainerTeam::MapTrainerTeam(unsigned _id)
+PokeGen::PokeMod::MapTrainerTeam::MapTrainerTeam(const unsigned _id)
{
LogCtor("MapTrainerTeam", _id);
species = -1;
@@ -34,7 +34,7 @@ PokeGen::PokeMod::MapTrainerTeam::MapTrainerTeam(unsigned _id)
id = _id;
}
-PokeGen::PokeMod::MapTrainerTeam::MapTrainerTeam(Ini &ini, unsigned _id)
+PokeGen::PokeMod::MapTrainerTeam::MapTrainerTeam(Ini &ini, const unsigned _id)
{
LogCtorIni("MapTrainerTeam", _id);
ImportIni(ini, _id);
@@ -99,7 +99,7 @@ void PokeGen::PokeMod::MapTrainerTeam::Validate(const wxListBox &output)
}
#endif
-void PokeGen::PokeMod::MapTrainerTeam::ImportIni(Ini &ini, unsigned _id)
+void PokeGen::PokeMod::MapTrainerTeam::ImportIni(Ini &ini, const unsigned _id)
{
LogImportStart("MapTrainerTeam");
if (_id == UINT_MAX)
@@ -117,7 +117,7 @@ void PokeGen::PokeMod::MapTrainerTeam::ImportIni(Ini &ini, unsigned _id)
LogImportOver("MapTrainerTeam", id);
}
-void PokeGen::PokeMod::MapTrainerTeam::ExportIni(Ini &ini, const String &map, unsigned trainerId) const
+void PokeGen::PokeMod::MapTrainerTeam::ExportIni(Ini &ini, const String &map, const unsigned trainerId) const
{
LogExportStart("MapTrainerTeam", id);
// Make elements
@@ -130,7 +130,7 @@ void PokeGen::PokeMod::MapTrainerTeam::ExportIni(Ini &ini, const String &map, un
LogExportOver("MapTrainerTeam", id);
}
-void PokeGen::PokeMod::MapTrainerTeam::SetSpecies(int s)
+void PokeGen::PokeMod::MapTrainerTeam::SetSpecies(const int s)
{
LogSetVar("MapTrainerTeam", id, "species", s);
if (curPokeMod.GetPokemon(s))
@@ -144,14 +144,14 @@ void PokeGen::PokeMod::MapTrainerTeam::SetSpecies(const String &s)
species = p->GetId();
}
-void PokeGen::PokeMod::MapTrainerTeam::SetLevel(unsigned l)
+void PokeGen::PokeMod::MapTrainerTeam::SetLevel(const unsigned l)
{
LogSetVar("MapTrainerTeam", id, "level", l, GetSpeciesString());
if (l <= curPokeMod.GetMaxLevel())
level = l;
}
-void PokeGen::PokeMod::MapTrainerTeam::SetItem(int i)
+void PokeGen::PokeMod::MapTrainerTeam::SetItem(const int i)
{
LogSetVar("MapTrainerTeam", id, "item", i, GetSpeciesString());
if (curPokeMod.GetItem(i))
diff --git a/pokemod/MapTrainerTeam.h b/pokemod/MapTrainerTeam.h
index e1492581..93a19dbe 100644
--- a/pokemod/MapTrainerTeam.h
+++ b/pokemod/MapTrainerTeam.h
@@ -35,17 +35,17 @@ namespace PokeGen
class MapTrainerTeam : public Object
{
public:
- MapTrainerTeam(unsigned _id);
- MapTrainerTeam(Ini &ini, unsigned _id = UINT_MAX);
+ MapTrainerTeam(const unsigned _id);
+ MapTrainerTeam(Ini &ini, const unsigned _id = UINT_MAX);
~MapTrainerTeam();
- void ImportIni(Ini &ini, unsigned _id = UINT_MAX);
- void ExportIni(Ini &ini, const String &map, unsigned trainerId) const;
+ void ImportIni(Ini &ini, const unsigned _id = UINT_MAX);
+ void ExportIni(Ini &ini, const String &map, const unsigned trainerId) const;
- void SetSpecies(int s);
- void SetSpecies(const String &s);
- void SetLevel(unsigned l);
- void SetItem(int i);
+ void SetSpecies(const int s);
+ void SetSpecies(const const String &s);
+ void SetLevel(const unsigned l);
+ void SetItem(const int i);
void SetItem(const String &i);
int GetSpecies() const;
diff --git a/pokemod/MapWildList.cpp b/pokemod/MapWildList.cpp
index 9973a8be..19fb79cc 100644
--- a/pokemod/MapWildList.cpp
+++ b/pokemod/MapWildList.cpp
@@ -25,7 +25,7 @@
extern PokeGen::PokeMod::Pokemod curPokeMod;
-PokeGen::PokeMod::MapWildList::MapWildList(unsigned _id)
+PokeGen::PokeMod::MapWildList::MapWildList(const unsigned _id)
{
LogCtor("MapWildList", _id);
control = 0;
@@ -36,7 +36,7 @@ PokeGen::PokeMod::MapWildList::MapWildList(unsigned _id)
id = _id;
}
-PokeGen::PokeMod::MapWildList::MapWildList(Ini &ini, unsigned _id)
+PokeGen::PokeMod::MapWildList::MapWildList(Ini &ini, const unsigned _id)
{
LogCtorIni("MapWildList", _id);
ImportIni(ini, _id);
@@ -50,7 +50,7 @@ PokeGen::PokeMod::MapWildList::~MapWildList()
}
#ifdef PG_DEBUG_WINDOW
-void PokeGen::PokeMod::MapWildList::Validate(wxListBox &output)
+void PokeGen::PokeMod::MapWildList::Validate(const wxListBox &output)
#else
void PokeGen::PokeMod::MapWildList::Validate()
#endif
@@ -64,7 +64,7 @@ void PokeGen::PokeMod::MapWildList::Validate()
PMLog("MapWildList Validation: Failed", PM_DEBUG_INFO);
}
-void PokeGen::PokeMod::MapWildList::ImportIni(Ini &ini, unsigned _id)
+void PokeGen::PokeMod::MapWildList::ImportIni(Ini &ini, const unsigned _id)
{
LogImportStart("MapWildList");
if (_id == UINT_MAX)
@@ -110,14 +110,14 @@ void PokeGen::PokeMod::MapWildList::ExportIni(std::ofstream &fout, const String
LogExportOver("MapWildList", id);
}
-void PokeGen::PokeMod::MapWildList::SetControl(unsigned c)
+void PokeGen::PokeMod::MapWildList::SetControl(const unsigned c)
{
LogSetVar("MapWildList", id, "control", c);
if ((CON_NONE < c) && (c < CON_END))
control = c;
}
-void PokeGen::PokeMod::MapWildList::SetValue(unsigned v)
+void PokeGen::PokeMod::MapWildList::SetValue(const unsigned v)
{
unsigned i = 0;
unsigned j = 0;
@@ -146,20 +146,18 @@ void PokeGen::PokeMod::MapWildList::SetValue(const String &v)
SetValue(i->GetId());
}
-void PokeGen::PokeMod::MapWildList::SetTime(unsigned ts, bool t)
+void PokeGen::PokeMod::MapWildList::SetTime(const unsigned ts, const bool t)
{
for (std::vector<unsigned>::iterator i = times.begin(); i != times.end(); ++i)
{
if (*i == ts)
{
- if (t)
- return;
- else
+ if (!t)
{
times.erase(i);
LogSetVar("MapWildList", id, String("time[%u]", ts), false);
- return;
}
+ return;
}
}
if (t)
@@ -169,13 +167,13 @@ void PokeGen::PokeMod::MapWildList::SetTime(unsigned ts, bool t)
}
}
-void PokeGen::PokeMod::MapWildList::SetTime(const String &ts, bool t)
+void PokeGen::PokeMod::MapWildList::SetTime(const const String &ts, const bool t)
{
LogSetVar("MapWildList", id, String("time[%u] string", ts), t);
SetTime(curPokeMod.GetTime(ts)->GetId(), t);
}
-void PokeGen::PokeMod::MapWildList::SetScope(unsigned s)
+void PokeGen::PokeMod::MapWildList::SetScope(const unsigned s)
{
LogSetVar("MapWildList", id, "scope", s);
unsigned i = 0;
@@ -214,7 +212,7 @@ unsigned PokeGen::PokeMod::MapWildList::GetValue() const
return value;
}
-bool PokeGen::PokeMod::MapWildList::GetTime(unsigned ts) const
+bool PokeGen::PokeMod::MapWildList::GetTime(const unsigned ts) const
{
LogFetchVar("MapWildList", id, String("time[%u]", ts), "???");
for (std::vector<unsigned>::iterator i = times.begin(); i != times.end(); ++i)
@@ -239,7 +237,7 @@ int PokeGen::PokeMod::MapWildList::GetScope() const
return scope;
}
-PokeGen::PokeMod::MapWildPokemon *PokeGen::PokeMod::MapWildList::GetMapWildPokemon(unsigned _id)
+PokeGen::PokeMod::MapWildPokemon *PokeGen::PokeMod::MapWildList::GetMapWildPokemon(const unsigned _id)
{
LogSubmoduleFetch("MapWildList", id, "Pokémon", _id);
for (unsigned i = 0; i < GetMapWildPokemonCount(); ++i)
@@ -285,7 +283,7 @@ void PokeGen::PokeMod::MapWildList::NewMapWildPokemon(Ini *const ini)
pokemon.push_back(newMapWildPokemon);
}
-void PokeGen::PokeMod::MapWildList::DeleteMapWildPokemon(unsigned _id)
+void PokeGen::PokeMod::MapWildList::DeleteMapWildPokemon(const unsigned _id)
{
LogSubmoduleRemoveStart("MapWildList", id, "Pokémon", _id, name);
for (std::vector<MapWildPokemon>::iterator i = effects.begin(); i != effects.end(); ++i)
diff --git a/pokemod/MapWildList.h b/pokemod/MapWildList.h
index 0ff599f5..e1372f7b 100644
--- a/pokemod/MapWildList.h
+++ b/pokemod/MapWildList.h
@@ -37,32 +37,32 @@ namespace PokeGen
class MapWildList : public Object
{
public:
- MapWildList(unsigned _id);
- MapWildList(Ini &ini, unsigned _id = UINT_MAX);
+ MapWildList(const unsigned _id);
+ MapWildList(Ini &ini, const unsigned _id = UINT_MAX);
~MapWildList();
- void ImportIni(Ini &ini, unsigned _id = UINT_MAX);
+ void ImportIni(Ini &ini, const unsigned _id = UINT_MAX);
void ExportIni(std::ofstream &fout, const String &map) const;
- void SetControl(unsigned c);
- void SetValue(unsigned v);
+ void SetControl(const unsigned c);
+ void SetValue(const unsigned v);
void SetValue(const String &v);
- void SetTime(unsigned ts, bool t);
- void SetTime(const String &ts, bool t);
- void SetScope(unsigned s);
+ void SetTime(const unsigned ts, const bool t);
+ void SetTime(const String &ts, const bool t);
+ void SetScope(const unsigned s);
void SetScope(const String &s);
unsigned GetControl() const;
unsigned GetValue() const;
- bool GetTime(unsigned ts) const;
+ bool GetTime(const unsigned ts) const;
bool GetTime(const String &ts) const;
int GetScope() const;
- MapWildPokemon *GetMapWildPokemon(unsigned _id);
+ MapWildPokemon *GetMapWildPokemon(const unsigned _id);
MapWildPokemon *GetMapWildPokemon(const String &n);
unsigned GetMapWildPokemonCount() const;
- void NewMapWildPokemon();
- void DeleteMapWildPokemon(unsigned _id);
+ void NewMapWildPokemon(Ini *const int = NULL);
+ void DeleteMapWildPokemon(const unsigned _id);
private:
void Validate();
# ifdef PG_DEBUG_WINDOW
diff --git a/pokemod/MapWildPokemon.cpp b/pokemod/MapWildPokemon.cpp
index eda00a55..fc0714c2 100644
--- a/pokemod/MapWildPokemon.cpp
+++ b/pokemod/MapWildPokemon.cpp
@@ -25,7 +25,7 @@
extern PokeGen::PokeMod::Pokemod curPokeMod;
-PokeGen::PokeMod::MapWildPokemon::MapWildPokemon(unsigned _id)
+PokeGen::PokeMod::MapWildPokemon::MapWildPokemon(const unsigned _id)
{
LogCtor("MapWildPokemon", _id);
pokemon = -1;
@@ -34,7 +34,7 @@ PokeGen::PokeMod::MapWildPokemon::MapWildPokemon(unsigned _id)
id = _id;
}
-PokeGen::PokeMod::MapWildPokemon::MapWildPokemon(Ini &ini, unsigned _id)
+PokeGen::PokeMod::MapWildPokemon::MapWildPokemon(Ini &ini, const unsigned _id)
{
LogCtorIni("MapWildPokemon", _id);
ImportIni(ini, _id);
@@ -99,7 +99,7 @@ void PokeGen::PokeMod::MapWildPokemon::Validate(const wxListBox &output)
}
#endif
-void PokeGen::PokeMod::MapWildPokemon::ImportIni(Ini &ini, unsigned _id)
+void PokeGen::PokeMod::MapWildPokemon::ImportIni(Ini &ini, const unsigned _id)
{
LogImportStart("MapWildPokemon");
if (_id == UINT_MAX)
@@ -130,7 +130,7 @@ void PokeGen::PokeMod::MapWildPokemon::ExportIni(std::ofstream &fout, const Stri
LogExportOver("MapWildPokemon", id, name);
}
-void PokeGen::PokeMod::MapWildPokemon::SetPokemon(int p)
+void PokeGen::PokeMod::MapWildPokemon::SetPokemon(const int p)
{
LogSetVar("MapWildPokemon", id, "pokemon", p);
if (curPokeMod.GetPokemon(p))
@@ -144,13 +144,13 @@ void PokeGen::PokeMod::MapWildPokemon::SetPokemon(const String &p)
pokemon = pok->GetId();
}
-void PokeGen::PokeMod::MapWildPokemon::SetLevel(unsigned l)
+void PokeGen::PokeMod::MapWildPokemon::SetLevel(const unsigned l)
{
LogSetVar("MapWildPokemon", id, "level", l, GetPokemonString());
level = l;
}
-void PokeGen::PokeMod::MapWildPokemon::SetWeight(unsigned w)
+void PokeGen::PokeMod::MapWildPokemon::SetWeight(const unsigned w)
{
LogSetVar("MapWildPokemon", id, "weight", w, GetPokemonString());
if (w)
diff --git a/pokemod/MapWildPokemon.h b/pokemod/MapWildPokemon.h
index 2a14f448..dcbb057b 100644
--- a/pokemod/MapWildPokemon.h
+++ b/pokemod/MapWildPokemon.h
@@ -35,17 +35,17 @@ namespace PokeGen
class MapWildPokemon: public Object
{
public:
- MapWildPokemon(unsigned _id);
- MapWildPokemon(Ini &ini, unsigned _id = UINT_MAX);
+ MapWildPokemon(const unsigned _id);
+ MapWildPokemon(Ini &ini, const unsigned _id = UINT_MAX);
~MapWildPokemon();
- void ImportIni(Ini &ini, unsigned _id = UINT_MAX);
+ void ImportIni(Ini &ini, const unsigned _id = UINT_MAX);
void ExportIni(std::ofstream &fout, const String &map, const unsigned listId) const;
- void SetPokemon(int p);
+ void SetPokemon(const int p);
void SetPokemon(const String &p);
- void SetLevel(unsigned l);
- void SetWeight(unsigned w);
+ void SetLevel(const unsigned l);
+ void SetWeight(const unsigned w);
int GetPokemon() const;
String GetPokemonString() const;
diff --git a/pokemod/Matrix.h b/pokemod/Matrix.h
index 27ad77c3..9cf89b8e 100644
--- a/pokemod/Matrix.h
+++ b/pokemod/Matrix.h
@@ -46,7 +46,7 @@ namespace PokeGen
{
ImportIni(ini);
}
- Matrix(unsigned w, unsigned h, const T &d = T())
+ Matrix(const unsigned w, const unsigned h, const T &d = T())
{
matrix.resize(w, std::vector<T>(h, d));
width = w;
@@ -74,7 +74,7 @@ namespace PokeGen
matrix.push_back(std::vector<T>(GetHeight(), d));
++width;
}
- bool InsertRow(unsigned pos, const T &d = T())
+ bool InsertRow(const unsigned pos, const T &d = T())
{
if (height < pos)
return false;
@@ -83,7 +83,7 @@ namespace PokeGen
++height;
return true;
}
- bool InsertCol(unsigned pos, const T &d = T())
+ bool InsertCol(const unsigned pos, const T &d = T())
{
if (width < pos)
return false;
@@ -91,7 +91,7 @@ namespace PokeGen
++width;
return true;
}
- bool DeleteRow(unsigned pos)
+ bool DeleteRow(const unsigned pos)
{
if (height <= pos)
return false;
@@ -100,7 +100,7 @@ namespace PokeGen
--height;
return true;
}
- bool DeleteCol(unsigned pos)
+ bool DeleteCol(const unsigned pos)
{
if (width <= pos)
return false;
@@ -109,7 +109,7 @@ namespace PokeGen
return true;
}
- bool Set(unsigned row, unsigned col, const T &s)
+ bool Set(const unsigned row, const unsigned col, const T &s)
{
if ((width <= col) || (height <= col))
return false;
@@ -117,20 +117,20 @@ namespace PokeGen
return true;
}
- T Get(unsigned row, unsigned col) const
+ T Get(const unsigned row, const unsigned col) const
{
if ((width <= col) || (height <= col))
return T();
return matrix[col][row];
}
- std::vector<T> GetRow(unsigned row) const
+ std::vector<T> GetRow(const unsigned row) const
{
std::vector<T> r;
for (std::vector<T> *i = matrix.begin(); i != matrix.end(); ++i)
r.push_back(i->at(row));
return r;
}
- std::vector<T> GetCol(unsigned col) const
+ std::vector<T> GetCol(const unsigned col) const
{
return matrix[col];
}
@@ -147,7 +147,7 @@ namespace PokeGen
{
return matrix[p.GetY()][p.GetX()];
}
- std::vector<T> operator[](int col) const
+ std::vector<T> operator[](const int col) const
{
return matrix[col];
}
diff --git a/pokemod/Move.h b/pokemod/Move.h
new file mode 100644
index 00000000..646d6cf7
--- /dev/null
+++ b/pokemod/Move.h
@@ -0,0 +1,108 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name: pokemod/Move.h
+// Purpose: Define a move that Pokémon can learn
+// Author: Ben Boeckel
+// Modified by: Ben Boeckel
+// Created: Sat May 26 2007 08:57:13
+// Copyright: ©2007 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_MOVE__
+#define __POKEMOD_MOVE__
+
+#include <vector>
+#include "Object.h"
+#include "String.h"
+#include "ItemEffect.h"
+
+namespace PokeGen
+{
+ namespace PokeMod
+ {
+ class Move : public Object
+ {
+ public:
+ Move(unsigned _id);
+ Move(Ini &ini, unsigned _id = UINT_MAX);
+ ~Move();
+
+ void ImportIni(Ini &ini, unsigned _id = UINT_MAX);
+ void ExportIni(std::ofstream &fout) const;
+
+ void SetName(const String &n);
+ void SetAccuracy(const Frac &a);
+ void SetAccuracyNum(unsigned n);
+ void SetAccuracyDenom(unsigned d);
+ void SetType(unsigned t);
+ void SetType(const String &t);
+ void SetSpecial(bool s);
+ void SetPowerPoints(unsigned p);
+ void SetTarget(int t);
+ void SetTarget(const String &t);
+ void SetNumTargets(unsigned n);
+ void SetTargetChoice(int t);
+ void SetTargetChoice(const String &t);
+ void SetIgnoreAccuracy(bool i);
+ void SetIgnoreFlinch(bool i);
+ void SetSound(bool s);
+ void SetDescription(const String &d);
+ void SetContestType(int c);
+ void SetContestType(const String &c);
+ void SetContestPoints(int c);
+ void SetJamPoints(int j);
+ void SetContestEffect(int c);
+ void SetContestEffect(const String &c);
+ void SetContestTarget(int c);
+ void SetContestTarget(const String &c);
+
+ String GetName() const;
+
+ MoveEffect *GetMoveEffect(unsigned _id);
+ unsigned GetMoveEffectCount() const;
+ void NewMoveEffect(Ini *const ini = NULL);
+ void DeleteMoveEffect(unsigned _id);
+ private:
+ void Validate();
+# ifdef PG_DEBUG_WINDOW
+ void Validate(const wxListBox &output);
+# endif
+
+ String name;
+ Frac accuracy;
+ unsigned power;
+ int type;
+ bool special;
+ unsigned powerPooints;
+ int target;
+ unsigned numTargets;
+ int targetCoice;
+ bool ignoreAccuracy;
+ bool ignoreFlinch;
+ bool sound;
+ String description;
+ int contestType;
+ int contestPoints;
+ int jamPoints;
+ int contestEffect;
+ int contestTarget;
+
+ std::vector<MoveEffect> effects;
+ };
+ }
+}
+
+#endif
diff --git a/pokemod/MoveEffect.cpp b/pokemod/MoveEffect.cpp
index 8558c44a..aea930be 100644
--- a/pokemod/MoveEffect.cpp
+++ b/pokemod/MoveEffect.cpp
@@ -25,7 +25,7 @@
extern PokeGen::PokeMod::Pokemod curPokeMod;
-PokeGen::PokeMod::MoveEffect::MoveEffect(unsigned _id)
+PokeGen::PokeMod::MoveEffect::MoveEffect(const unsigned _id)
{
LogCtor("MoveEffect", _id);
chance.Set(1, 1);
@@ -35,7 +35,7 @@ PokeGen::PokeMod::MoveEffect::MoveEffect(unsigned _id)
id = _id;
}
-PokeGen::PokeMod::MoveEffect::MoveEffect(Ini &ini, unsigned _id)
+PokeGen::PokeMod::MoveEffect::MoveEffect(Ini &ini, const unsigned _id)
{
LogCtorIni("MoveEffect", _id);
ImportIni(ini, _id);
@@ -60,7 +60,7 @@ void PokeGen::PokeMod::MoveEffect::Validate()
LogValidateOver("MoveEffect", id, isValid);
}
-void PokeGen::PokeMod::MoveEffect::ImportIni(Ini &ini, unsigned _id)
+void PokeGen::PokeMod::MoveEffect::ImportIni(Ini &ini, const unsigned _id)
{
LogImportStart("MoveEffect");
if (_id == UINT_MAX)
@@ -103,25 +103,25 @@ void PokeGen::PokeMod::MoveEffect::SetChance(const Frac &c)
chance = c;
}
-void PokeGen::PokeMod::MoveEffect::SetChance(unsigned n, unsigned d)
+void PokeGen::PokeMod::MoveEffect::SetChance(const unsigned n, const unsigned d)
{
LogSetVar("MoveEffect", id, "chance", n, d);
chance.Set(n, d);
}
-void PokeGen::PokeMod::MoveEffect::SetChanceNum(unsigned n)
+void PokeGen::PokeMod::MoveEffect::SetChanceNum(const unsigned n)
{
LogSetVar("MoveEffect", id, "chance numerator", n, true);
chance.SetNum(n);
}
-void PokeGen::PokeMod::MoveEffect::SetChanceDenom(unsigned d)
+void PokeGen::PokeMod::MoveEffect::SetChanceDenom(const unsigned d)
{
LogSetVar("MoveEffect", id, "chance denominator", d, false);
chance.SetDenom(d);
}
-void PokeGen::PokeMod::MoveEffect::SetEffect(int e)
+void PokeGen::PokeMod::MoveEffect::SetEffect(const int e)
{
LogSetVar("MoveEffect", id, "effect", e);
effect = e;
@@ -138,13 +138,13 @@ void PokeGen::PokeMod::MoveEffect::SetEffect(const String &e)
}
// TODO (Ben#1#): Effect code
-void PokeGen::PokeMod::MoveEffect::SetVal1(int v1)
+void PokeGen::PokeMod::MoveEffect::SetVal1(const int v1)
{
PMLog("MoveEffect: Setting val1", PM_DEBUG_DEBUG);
val1 = v1;
}
-void PokeGen::PokeMod::MoveEffect::SetVal2(int v2)
+void PokeGen::PokeMod::MoveEffect::SetVal2(const int v2)
{
PMLog("MoveEffect: Setting val2", PM_DEBUG_DEBUG);
val2 = v2;
diff --git a/pokemod/MoveEffect.h b/pokemod/MoveEffect.h
index d30bfe09..b877be80 100644
--- a/pokemod/MoveEffect.h
+++ b/pokemod/MoveEffect.h
@@ -36,21 +36,21 @@ namespace PokeGen
class MoveEffect : public Object
{
public:
- MoveEffect(unsigned _id);
- MoveEffect(Ini &ini, unsigned _id = UINT_MAX);
+ MoveEffect(const unsigned _id);
+ MoveEffect(Ini &ini, const unsigned _id = UINT_MAX);
~MoveEffect();
- void ImportIni(Ini &ini, unsigned _id = UINT_MAX);
+ void ImportIni(Ini &ini, const unsigned _id = UINT_MAX);
void ExportIni(std::ofstream _fout, const String &move);
void SetChance(const Frac &c);
- void SetChance(unsigned n, unsigned d);
- void SetChanceNum(unsigned n);
- void SetChanceDenom(unsigned d);
- void SetEffect(int e);
+ void SetChance(const unsigned n, const unsigned d);
+ void SetChanceNum(const unsigned n);
+ void SetChanceDenom(const unsigned d);
+ void SetEffect(const int e);
void SetEffect(const String &e);
- void SetVal1(int v1);
- void SetVal2(int v2);
+ void SetVal1(const int v1);
+ void SetVal2(const int v2);
void SetVal2(const String &v2);
Frac GetChance();
diff --git a/pokemod/Nature.cpp b/pokemod/Nature.cpp
index 404b759f..261ad56f 100644
--- a/pokemod/Nature.cpp
+++ b/pokemod/Nature.cpp
@@ -23,7 +23,7 @@
#include "Nature.h"
-PokeGen::PokeMod::Nature::Nature(unsigned _id)
+PokeGen::PokeMod::Nature::Nature(const unsigned _id)
{
LogCtor("Nature", _id);
name = "";
@@ -31,7 +31,7 @@ PokeGen::PokeMod::Nature::Nature(unsigned _id)
id = _id;
}
-PokeGen::PokeMod::Nature::Nature(Ini &ini, unsigned _id)
+PokeGen::PokeMod::Nature::Nature(Ini &ini, const unsigned _id)
{
LogCtorIni("Nature", _id);
ImportIni(ini, _id);
@@ -100,7 +100,7 @@ void PokeGen::PokeMod::Nature::Validate(const wxListBox &output)
}
#endif
-void PokeGen::PokeMod::Nature::ImportIni(Ini &ini, unsigned _id)
+void PokeGen::PokeMod::Nature::ImportIni(Ini &ini, const unsigned _id)
{
LogImportStart("Nature");
String curName;
@@ -141,7 +141,7 @@ PokeGen::PokeMod::String PokeGen::PokeMod::Nature::GetName() const
return name;
}
-PokeGen::PokeMod::NatureEffect *PokeGen::PokeMod::Nature::GetNatureEffect(unsigned _id)
+PokeGen::PokeMod::NatureEffect *PokeGen::PokeMod::Nature::GetNatureEffect(const unsigned _id)
{
LogSubmoduleFetch("Nature", id, "effect", _id, name);
for (unsigned i = 0; i < GetNatureEffectCount(); ++i)
@@ -175,7 +175,7 @@ void PokeGen::PokeMod::Nature::NewNatureEffect(Ini *const ini)
effects.push_back(newNatureEffect);
}
-void PokeGen::PokeMod::Nature::DeleteNatureEffect(unsigned _id)
+void PokeGen::PokeMod::Nature::DeleteNatureEffect(const unsigned _id)
{
LogSubmoduleRemoveStart("Nature", id, "effect", _id, name);
for (std::vector<NatureEffect>::iterator i = effects.begin(); i != effects.end(); ++i)
diff --git a/pokemod/Nature.h b/pokemod/Nature.h
index b3f6cbd7..b066726c 100644
--- a/pokemod/Nature.h
+++ b/pokemod/Nature.h
@@ -25,7 +25,6 @@
#define __POKEMOD_NATURE__
#include <vector>
-#include <list>
#include "Object.h"
#include "String.h"
#include "NatureEffect.h"
@@ -37,21 +36,21 @@ namespace PokeGen
class Nature : public Object
{
public:
- Nature(unsigned _id);
- Nature(Ini &ini, unsigned _id = UINT_MAX);
+ Nature(const unsigned _id);
+ Nature(Ini &ini, const unsigned _id = UINT_MAX);
~Nature();
- void ImportIni(Ini &ini, unsigned _id = UINT_MAX);
+ void ImportIni(Ini &ini, const unsigned _id = UINT_MAX);
void ExportIni(std::ofstream &fout) const;
void SetName(const String &n);
String GetName() const;
- NatureEffect *GetNatureEffect(unsigned _id);
+ NatureEffect *GetNatureEffect(const unsigned _id);
unsigned GetNatureEffectCount() const;
void NewNatureEffect(Ini *const ini = NULL);
- void DeleteNatureEffect(unsigned _id);
+ void DeleteNatureEffect(const unsigned _id);
private:
void Validate();
# ifdef PG_DEBUG_WINDOW
diff --git a/pokemod/NatureEffect.cpp b/pokemod/NatureEffect.cpp
index 6b249a58..95be307b 100644
--- a/pokemod/NatureEffect.cpp
+++ b/pokemod/NatureEffect.cpp
@@ -23,7 +23,7 @@
#include "NatureEffect.h"
-PokeGen::PokeMod::NatureEffect::NatureEffect(unsigned _id)
+PokeGen::PokeMod::NatureEffect::NatureEffect(const unsigned _id)
{
LogCtor("NatureEffect", _id);
stat = 0;
@@ -31,7 +31,7 @@ PokeGen::PokeMod::NatureEffect::NatureEffect(unsigned _id)
id = _id;
}
-PokeGen::PokeMod::NatureEffect::NatureEffect(Ini &ini, unsigned _id)
+PokeGen::PokeMod::NatureEffect::NatureEffect(Ini &ini, const unsigned _id)
{
LogCtorIni("NatureEffect", _id);
ImportIni(ini, _id);
@@ -55,7 +55,7 @@ void PokeGen::PokeMod::NatureEffect::Validate()
LogValidateOver("NatureEffect", _id);
}
-void PokeGen::PokeMod::NatureEffect::ImportIni(Ini &ini, unsigned _id)
+void PokeGen::PokeMod::NatureEffect::ImportIni(Ini &ini, const unsigned _id)
{
PMLog("NatureEffect Import: Starting", PM_DEBUG_INFO);
std::string curName;
@@ -88,7 +88,7 @@ void PokeGen::PokeMod::NatureEffect::ExportXml(std::ofstream &fout, const String
LogExportOver("NatureEffect", id, name);
}
-void PokeGen::PokeMod::NatureEffect::SetStat(unsigned s)
+void PokeGen::PokeMod::NatureEffect::SetStat(const unsigned s)
{
LogSetVar("NatureEffect", id, "stat", s);
stat = s;
@@ -106,19 +106,19 @@ void PokeGen::PokeMod::NatureEffect::SetMultiplier(const Frac &m)
multiplier = m;
}
-void PokeGen::PokeMod::NatureEffect::SetMultiplier(unsigned n, unsigned d)
+void PokeGen::PokeMod::NatureEffect::SetMultiplier(const unsigned n, const unsigned d)
{
LogSetVar("NatureEffect", id, "multiplier", n, d);
multiplier.Set(n, d);
}
-void PokeGen::PokeMod::NatureEffect::SetMultiplierNum(unsigned n)
+void PokeGen::PokeMod::NatureEffect::SetMultiplierNum(const unsigned n)
{
LogSetVar("NatureEffect", id, "multiplier numerator", n);
multiplier.SetNum(n);
}
-void PokeGen::PokeMod::NatureEffect::SetMultiplierDenom(unsigned d)
+void PokeGen::PokeMod::NatureEffect::SetMultiplierDenom(const unsigned d)
{
LogSetVar("NatureEffect", id, "multiplier denominator", d);
multiplier.SetDenom(d);
diff --git a/pokemod/NatureEffect.h b/pokemod/NatureEffect.h
index 9c41c0a2..55c353e0 100644
--- a/pokemod/NatureEffect.h
+++ b/pokemod/NatureEffect.h
@@ -35,19 +35,19 @@ namespace PokeGen
class NatureEffect : public Object
{
public:
- NatureEffect(unsigned _id);
- NatureEffect(Ini &ini, unsigned _id = UINT_MAX);
+ NatureEffect(const unsigned _id);
+ NatureEffect(Ini &ini, const unsigned _id = UINT_MAX);
~NatureEffect();
- void ImportIni(Ini &ini, unsigned _id = UINT_MAX);
+ void ImportIni(Ini &ini, const unsigned _id = UINT_MAX);
void ExportIni(std::ofstream &fout, const String &nature) const;
- void SetStat(unsigned s);
+ void SetStat(const unsigned s);
void SetStat(const String &s);
void SetMultiplier(const Frac &m);
- void SetMultiplier(unsigned n, unsigned d);
- void SetMultiplierNum(unsigned n);
- void SetMultiplierDenom(unsigned d);
+ void SetMultiplier(const unsigned n, const unsigned d);
+ void SetMultiplierNum(const unsigned n);
+ void SetMultiplierDenom(const unsigned d);
unsigned GetStat() const;
String GetStatString() const;
diff --git a/pokemod/Object.h b/pokemod/Object.h
index d5dec248..30e0241b 100644
--- a/pokemod/Object.h
+++ b/pokemod/Object.h
@@ -40,7 +40,7 @@ namespace PokeGen
{
public:
virtual ~Object();
- virtual void ExportIni(const std::ofstream &fout) const;
+ virtual void ExportIni(std::ofstream &fout) const;
unsigned GetId() const;
bool IsValid();
diff --git a/pokemod/Point.h b/pokemod/Point.h
index 3e8d8293..014e2283 100644
--- a/pokemod/Point.h
+++ b/pokemod/Point.h
@@ -35,21 +35,21 @@ namespace PokeGen
{
public:
inline Point(): x(0), y(0) {}
- inline Point(int _x, int _y): x(_x), y(_y) {}
+ inline Point(const int _x, const int _y): x(_x), y(_y) {}
void ImportIni(Ini &ini);
void ExportIni(std::ofstream &fout, const String &val) const;
- inline void Set(int _x, int _y)
+ inline void Set(const int _x, const int _y)
{
x = _x;
y = _y;
}
- inline void SetX(int _x)
+ inline void SetX(const int _x)
{
x = _x;
}
- inline void SetY(int _y)
+ inline void SetY(const int _y)
{
y = _y;
}
diff --git a/pokemod/Pokemod.h b/pokemod/Pokemod.h
index d94bf794..24eb6a7d 100644
--- a/pokemod/Pokemod.h
+++ b/pokemod/Pokemod.h
@@ -55,65 +55,65 @@ namespace PokeGen
bool IsSpecialSplit();
bool IsSpecialDVSplit();
- Ability *GetAbility(unsigned _id);
- Ability *GetAbility(const String &name);
- unsigned GetAbilityCount();
- void NewAbility();
- void DeleteAbility(unsigned _id);
+ Ability *GetAbility(const unsigned _id);
+ Ability *GetAbility(const String &n);
+ unsigned GetAbilityCount() const;
+ void NewAbility(Ini *const ini = NULL);
+ void DeleteAbility(const unsigned _id);
- Author *GetAuthor(unsigned _id);
- Author *GetAuthor(const String &name);
- unsigned GetAuthorCount();
- void NewAuthor();
- void DeleteAuthor(unsigned _id);
+ Author *GetAuthor(const unsigned _id);
+ Author *GetAuthor(const String &n);
+ unsigned GetAuthorCount() const;
+ void NewAuthor(Ini *const ini = NULL);
+ void DeleteAuthor(const unsigned _id);
- Badge *GetBadge(unsigned _id);
- Badge *GetBadge(const String &name);
- unsigned GetBadgeCount();
- void NewBadge();
- void DeleteBadge(unsigned _id);
+ Badge *GetBadge(const unsigned _id);
+ Badge *GetBadge(const String &n);
+ unsigned GetBadgeCount() const;
+ void NewBadge(Ini *const ini = NULL);
+ void DeleteBadge(const unsigned _id);
- CoinList *GetCoinList(unsigned _id);
- CoinList *GetCoinList(const String &name);
- unsigned GetCoinListCount();
- void NewCoinList();
- void DeleteCoinList(unsigned _id);
+ CoinList *GetCoinList(const unsigned _id);
+ CoinList *GetCoinList(const String &n);
+ unsigned GetCoinListCount() const;
+ void NewCoinList(Ini *const ini = NULL);
+ void DeleteCoinList(const unsigned _id);
- Item *GetItem(unsigned _id);
- Item *GetItem(const String &name);
- unsigned GetItemCount();
- void NewItem();
- void DeleteItem(unsigned _id);
+ Item *GetItem(const unsigned _id);
+ Item *GetItem(const String &n);
+ unsigned GetItemCount() const;
+ void NewItem(Ini *const ini = NULL);
+ void DeleteItem(const unsigned _id);
- ItemStorage *GetItemStorage(unsigned _id);
- ItemStorage *GetItemStorage(const String &name);
- unsigned GetItemStorageCount();
- void NewItemStorage();
- void DeleteItemStorage(unsigned _id);
+ ItemStorage *GetItemStorage(const unsigned _id);
+ ItemStorage *GetItemStorage(const String &n);
+ unsigned GetItemStorageCount() const;
+ void NewItemStorage(Ini *const ini = NULL);
+ void DeleteItemStorage(const unsigned _id);
- Nature *GetNature(unsigned _id);
- Nature *GetNature(const String &name);
- unsigned GetNatureCount();
- void NewNature();
- void DeleteNature(unsigned _id);
+ Nature *GetNature(const unsigned _id);
+ Nature *GetNature(const String &n);
+ unsigned GetNatureCount() const;
+ void NewNature(Ini *const ini = NULL);
+ void DeleteNature(const unsigned _id);
- Store *GetStore(unsigned _id);
- Store *GetStore(const String &name);
- unsigned GetStoreCount();
- void NewStore();
- void DeleteStore(unsigned _id);
+ Store *GetStore(const unsigned _id);
+ Store *GetStore(const String &n);
+ unsigned GetStoreCount() const;
+ void NewStore(Ini *const ini = NULL);
+ void DeleteStore(const unsigned _id);
- Time *GetTime(unsigned _id);
- Time *GetTime(const String &name);
- unsigned GetTimeCount();
- void NewTime();
- void DeleteTime(unsigned _id);
+ Time *GetTime(const unsigned _id);
+ Time *GetTime(const String &n);
+ unsigned GetTimeCount() const;
+ void NewTime(Ini *const ini = NULL);
+ void DeleteTime(const unsigned _id);
- Type *GetType(unsigned _id);
- Type *GetType(const String &name);
- unsigned GetTypeCount();
- void NewType();
- void DeleteType(unsigned _id);
+ Type *GetType(const unsigned _id);
+ Type *GetType(const String &n);
+ unsigned GetTypeCount() const;
+ void NewType(Ini *const ini = NULL);
+ void DeleteType(const unsigned _id);
private:
void Validate();
# ifdef POKEMODR
diff --git a/pokemod/PokemonAbility.cpp b/pokemod/PokemonAbility.cpp
index d67c510d..fbd1b5f2 100644
--- a/pokemod/PokemonAbility.cpp
+++ b/pokemod/PokemonAbility.cpp
@@ -25,7 +25,7 @@
extern PokeGen::PokeMod::Pokemod curPokeMod;
-PokeGen::PokeMod::PokemonAbility::PokemonAbility(unsigned _id)
+PokeGen::PokeMod::PokemonAbility::PokemonAbility(const unsigned _id)
{
LogCtor("PokemonAbility", _id);
ability = -1;
@@ -33,7 +33,7 @@ PokeGen::PokeMod::PokemonAbility::PokemonAbility(unsigned _id)
id = _id;
}
-PokeGen::PokeMod::PokemonAbility::PokemonAbility(Ini &ini, unsigned _id)
+PokeGen::PokeMod::PokemonAbility::PokemonAbility(Ini &ini, const unsigned _id)
{
LogCtorIni("PokemonAbility", _id);
ImportIni(ini, _id);
@@ -84,7 +84,7 @@ void PokeGen::PokeMod::PokemonAbility::Validate(const wxListBox &output)
}
#endif
-void PokeGen::PokeMod::PokemonAbility::ImportIni(Ini &ini, unsigned _id)
+void PokeGen::PokeMod::PokemonAbility::ImportIni(Ini &ini, const unsigned _id)
{
LogImportStart("PokemonAbility");
if (_id == UINT_MAX)
@@ -113,7 +113,7 @@ void PokeGen::PokeMod::PokemonAbility::ExportIni(std::ofstream &fout, const Stri
LogExportOver("PokemonAbility", id);
}
-void PokeGen::PokeMod::PokemonAbility::SetAbility(int a)
+void PokeGen::PokeMod::PokemonAbility::SetAbility(const int a)
{
LogSetVar("PokemonAbility", id, "ability", a);
ability = a;
@@ -126,7 +126,7 @@ void PokeGen::PokeMod::PokemonAbility::SetAbility(const String &a)
ability = a->GetId();
}
-void PokeGen::PokeMod::PokemonAbility::SetWeight(unsigned w)
+void PokeGen::PokeMod::PokemonAbility::SetWeight(const unsigned w)
{
LogSetVar("PokemonAbility", id, "weight", w, GetAbilityString());
if (w)
diff --git a/pokemod/PokemonAbility.h b/pokemod/PokemonAbility.h
index 133b6146..4ae864cf 100644
--- a/pokemod/PokemonAbility.h
+++ b/pokemod/PokemonAbility.h
@@ -35,16 +35,16 @@ namespace PokeGen
class PokemonAbility : public Object
{
public:
- PokemonAbility(unsigned _id);
- PokemonAbility(Ini &ini, unsigned _id = UINT_MAX);
+ PokemonAbility(const unsigned _id);
+ PokemonAbility(Ini &ini, const unsigned _id = UINT_MAX);
~PokemonAbility();
- void ImportIni(Ini &ini, unsigned _id = UINT_MAX);
+ void ImportIni(Ini &ini, const unsigned _id = UINT_MAX);
void ExportIni(std::ofstream &fout, const String &pokemon) const;
- void SetAbility(int a);
+ void SetAbility(const int a);
void SetAbility(const String &a);
- void SetWeight(unsigned w);
+ void SetWeight(const unsigned w);
int GetAbility() const;
String GetAbilityString() const;
diff --git a/pokemod/PokemonEvolution.cpp b/pokemod/PokemonEvolution.cpp
index 94148e2b..8290532c 100644
--- a/pokemod/PokemonEvolution.cpp
+++ b/pokemod/PokemonEvolution.cpp
@@ -25,7 +25,7 @@
extern PokeGen::PokeMod::Pokemod curPokeMod;
-PokeGen::PokeMod::PokemonEvolution::PokemonEvolution(unsigned _id)
+PokeGen::PokeMod::PokemonEvolution::PokemonEvolution(const unsigned _id)
{
LogCtor("PokemonEvolution", _id);
species = -1;
@@ -36,7 +36,7 @@ PokeGen::PokeMod::PokemonEvolution::PokemonEvolution(unsigned _id)
id = _id;
}
-PokeGen::PokeMod::PokemonEvolution::PokemonEvolution(Ini &ini, unsigned _id)
+PokeGen::PokeMod::PokemonEvolution::PokemonEvolution(Ini &ini, const unsigned _id)
{
LogCtorIni("PokemonEvolution", _id);
ImportIni(ini, _id);
@@ -109,7 +109,7 @@ void PokeGen::PokeMod::PokemonEvolution::Validate(const wxListBox &output)
}
#endif
-void PokeGen::PokeMod::PokemonEvolution::ImportIni(Ini &ini, unsigned _id)
+void PokeGen::PokeMod::PokemonEvolution::ImportIni(Ini &ini, const unsigned _id)
{
LogImportStart("PokemonEvolution");
if (_id == UINT_MAX)
@@ -144,7 +144,7 @@ void PokeGen::PokeMod::PokemonEvolution::ExportIni(std::ofstream &fout, const St
LogExportOver("PokemonEvolution", id);
}
-void PokeGen::PokeMod::PokemonEvolution::SetSpecies(int s)
+void PokeGen::PokeMod::PokemonEvolution::SetSpecies(const int s)
{
LogSetVar("PokemonEvolution", id, "species", s);
species = s;
@@ -157,19 +157,19 @@ void PokeGen::PokeMod::PokemonEvolution::SetSpecies(const String &s)
species = temp->GetId();
}
-void PokeGen::PokeMod::PokemonEvolution::SetStyle(int s)
+void PokeGen::PokeMod::PokemonEvolution::SetStyle(const int s)
{
LogSetVar("PokemonEvolution", id, "style", s);
style = s;
}
-void PokeGen::PokeMod::PokemonEvolution::SetLevel(unsigned l)
+void PokeGen::PokeMod::PokemonEvolution::SetLevel(const unsigned l)
{
LogSetVar("PokemonEvolution", id, "level", l);
level = l;
}
-void PokeGen::PokeMod::PokemonEvolution::SetItem(int i)
+void PokeGen::PokeMod::PokemonEvolution::SetItem(const int i)
{
LogSetVar("PokemonEvolution", id, "item", i);
item = i;
@@ -182,7 +182,7 @@ void PokeGen::PokeMod::PokemonEvolution::SetItem(const String &i)
item = temp->GetId();
}
-void PokeGen::PokeMod::PokemonEvolution::SetHappiness(unsigned h)
+void PokeGen::PokeMod::PokemonEvolution::SetHappiness(const unsigned h)
{
LogSetVar("PokemonEvolution", id, "happiness", h);
happiness = h;
diff --git a/pokemod/PokemonEvolution.h b/pokemod/PokemonEvolution.h
index 554e0ed2..a249f3cc 100644
--- a/pokemod/PokemonEvolution.h
+++ b/pokemod/PokemonEvolution.h
@@ -35,20 +35,20 @@ namespace PokeGen
class PokemonEvolution : public Object
{
public:
- PokemonEvolution(unsigned _id);
- PokemonEvolution(Ini &ini, unsigned _id = UINT_MAX);
+ PokemonEvolution(const unsigned _id);
+ PokemonEvolution(Ini &ini, const unsigned _id = UINT_MAX);
~PokemonEvolution();
- void ImportIni(Ini &ini, unsigned _id = UINT_MAX);
+ void ImportIni(Ini &ini, const unsigned _id = UINT_MAX);
void ExportIni(std::ofstream &fout, const String &pokemon) const;
- void SetSpecies(int s);
+ void SetSpecies(const int s);
void SetSpecies(const String &s);
- void SetStyle(int s);
- void SetLevel(unsigned l);
- void SetItem(int i);
+ void SetStyle(const int s);
+ void SetLevel(const unsigned l);
+ void SetItem(const int i);
void SetItem(const String &i);
- void SetHappiness(unsigned h);
+ void SetHappiness(const unsigned h);
int GetSpecies() const;
String GetSpeciesString() const;
diff --git a/pokemod/PokemonItem.cpp b/pokemod/PokemonItem.cpp
index 906f2080..1fa640b8 100644
--- a/pokemod/PokemonItem.cpp
+++ b/pokemod/PokemonItem.cpp
@@ -25,7 +25,7 @@
extern PokeGen::PokeMod::Pokemod curPokeMod;
-PokeGen::PokeMod::PokemonItem::PokemonItem(unsigned _id)
+PokeGen::PokeMod::PokemonItem::PokemonItem(const unsigned _id)
{
LogCtor("PokemonItem", _id);
item = -1;
@@ -33,7 +33,7 @@ PokeGen::PokeMod::PokemonItem::PokemonItem(unsigned _id)
id = _id;
}
-PokeGen::PokeMod::PokemonItem::PokemonItem(Ini &ini, unsigned _id)
+PokeGen::PokeMod::PokemonItem::PokemonItem(Ini &ini, const unsigned _id)
{
LogCtorIni("PokemonItem", _id);
ImportIni(ini, _id);
@@ -84,7 +84,7 @@ void PokeGen::PokeMod::PokemonItem::Validate(const wxListBox &output)
}
#endif
-void PokeGen::PokeMod::PokemonItem::ImportIni(Ini &ini, unsigned _id)
+void PokeGen::PokeMod::PokemonItem::ImportIni(Ini &ini, const unsigned _id)
{
LogImportStart("PokemonItem");
if (_id == UINT_MAX)
@@ -113,7 +113,7 @@ void PokeGen::PokeMod::PokemonItem::ExportIni(std::ofstream &fout, const String
LogExportOver("PokemonItem", id);
}
-void PokeGen::PokeMod::PokemonItem::SetItem(int i)
+void PokeGen::PokeMod::PokemonItem::SetItem(const int i)
{
if (curPokeMod.GetItem(i))
{
@@ -131,7 +131,7 @@ void PokeGen::PokeMod::PokemonItem::SetItem(const String &i)
item = temp->GetId();
}
-void PokeGen::PokeMod::PokemonItem::SetWeight(unsigned w)
+void PokeGen::PokeMod::PokemonItem::SetWeight(const unsigned w)
{
LogSetVar("PokemonItem", id, "weight", w);
if (w)
diff --git a/pokemod/PokemonItem.h b/pokemod/PokemonItem.h
index b1fe7673..2c884aec 100644
--- a/pokemod/PokemonItem.h
+++ b/pokemod/PokemonItem.h
@@ -35,16 +35,16 @@ namespace PokeGen
class PokemonItem : public Object
{
public:
- PokemonItem(unsigned _id);
- PokemonItem(Ini &ini, unsigned _id = UINT_MAX);
+ PokemonItem(const unsigned _id);
+ PokemonItem(Ini &ini, const unsigned _id = UINT_MAX);
~PokemonItem();
- void ImportIni(Ini &ini, unsigned _id = UINT_MAX);
+ void ImportIni(Ini &ini, const unsigned _id = UINT_MAX);
void ExportIni(std::ofstream &fout, const String &pokemon) const;
- void SetItem(int i);
+ void SetItem(const int i);
void SetItem(const String &i);
- void SetWeight(unsigned w);
+ void SetWeight(const unsigned w);
int GetItem() const;
String GetItemString() const;
diff --git a/pokemod/PokemonMove.cpp b/pokemod/PokemonMove.cpp
index 53703387..848fc116 100644
--- a/pokemod/PokemonMove.cpp
+++ b/pokemod/PokemonMove.cpp
@@ -25,7 +25,7 @@
extern PokeGen::PokeMod::Pokemod curPokeMod;
-PokeGen::PokeMod::PokemonMove::PokemonMove(unsigned _id)
+PokeGen::PokeMod::PokemonMove::PokemonMove(const unsigned _id)
{
LogCtor("PokemonMove", _id);
move = -1;
@@ -34,7 +34,7 @@ PokeGen::PokeMod::PokemonMove::PokemonMove(unsigned _id)
id = _id;
}
-PokeGen::PokeMod::PokemonMove::PokemonMove(Ini &ini, unsigned _id)
+PokeGen::PokeMod::PokemonMove::PokemonMove(Ini &ini, const unsigned _id)
{
LogCtorIni("PokemonMove", _id);
ImportIni(ini, _id);
@@ -96,7 +96,7 @@ void PokeGen::PokeMod::PokemonMove::Validate(const wxListBox &output)
}
#endif
-void PokeGen::PokeMod::PokemonMove::ImportIni(Ini &ini, unsigned _id)
+void PokeGen::PokeMod::PokemonMove::ImportIni(Ini &ini, const unsigned _id)
{
LogImportStart("PokemonMove");
if (_id == UINT_MAX)
@@ -127,7 +127,7 @@ void PokeGen::PokeMod::PokemonMove::ExportIni(std::ofstream &fout, const String
LogExportOver("PokemonMove", id);
}
-void PokeGen::PokeMod::PokemonMove::SetMove(int m)
+void PokeGen::PokeMod::PokemonMove::SetMove(const int m)
{
LogSetVar("PokemonMove", id, "move", m);
move = m;
@@ -140,13 +140,13 @@ void PokeGen::PokeMod::PokemonMove::SetMove(const String &m)
move = temp->GetId();
}
-void PokeGen::PokeMod::PokemonMove::SetLevel(unsigned l)
+void PokeGen::PokeMod::PokemonMove::SetLevel(const unsigned l)
{
LogSetVar("PokemonMove", id, "level", l, GetMoveString());
level = l;
}
-void PokeGen::PokeMod::PokemonMove::SetWild(unsigned w)
+void PokeGen::PokeMod::PokemonMove::SetWild(const unsigned w)
{
LogSetVar("PokemonMove", id, "wild", w, GetMoveString());
wild = w;
diff --git a/pokemod/PokemonMove.h b/pokemod/PokemonMove.h
index 449bfec0..3c7cda9a 100644
--- a/pokemod/PokemonMove.h
+++ b/pokemod/PokemonMove.h
@@ -35,17 +35,17 @@ namespace PokeGen
class PokemonMove : public Object
{
public:
- PokemonMove(unsigned _id);
- PokemonMove(Ini &ini, unsigned _id = UINT_MAX);
+ PokemonMove(const unsigned _id);
+ PokemonMove(Ini &ini, const unsigned _id = UINT_MAX);
~PokemonMove();
- void ImportIni(Ini &ini, unsigned _id = UINT_MAX);
+ void ImportIni(Ini &ini, const unsigned _id = UINT_MAX);
void ExportIni(std::ofstream &fout, const String &pokemon) const;
- void SetMove(int m);
+ void SetMove(const int m);
void SetMove(const String &m);
- void SetLevel(unsigned l);
- void SetWild(unsigned w);
+ void SetLevel(const unsigned l);
+ void SetWild(const unsigned w);
int GetMove() const;
String GetMoveString() const;
diff --git a/pokemod/PokemonNature.cpp b/pokemod/PokemonNature.cpp
index ead7cd2f..2e5c6543 100644
--- a/pokemod/PokemonNature.cpp
+++ b/pokemod/PokemonNature.cpp
@@ -25,7 +25,7 @@
extern PokeGen::PokeMod::Pokemod curPokeMod;
-PokeGen::PokeMod::PokemonNature::PokemonNature(unsigned _id)
+PokeGen::PokeMod::PokemonNature::PokemonNature(const unsigned _id)
{
LogCtor("PokemonNature", _id);
nature = -1;
@@ -33,7 +33,7 @@ PokeGen::PokeMod::PokemonNature::PokemonNature(unsigned _id)
id = _id;
}
-PokeGen::PokeMod::PokemonNature::PokemonNature(Ini &ini, unsigned _id)
+PokeGen::PokeMod::PokemonNature::PokemonNature(Ini &ini, const unsigned _id)
{
LogCtorIni("PokemonNature", _id);
ImportIni(ini, _id);
@@ -84,7 +84,7 @@ void PokeGen::PokeMod::PokemonNature::Validate(const wxListBox &output)
}
#endif
-void PokeGen::PokeMod::PokemonNature::ImportIni(Ini &ini, unsigned _id)
+void PokeGen::PokeMod::PokemonNature::ImportIni(Ini &ini, const unsigned _id)
{
LogImportStart("PokemonNature");
if (_id == UINT_MAX)
@@ -113,7 +113,7 @@ void PokeGen::PokeMod::PokemonNature::ExportIni(std::ofstream &fout, const Strin
LogExportOver("PokemonNature", id);
}
-void PokeGen::PokeMod::PokemonNature::SetNature(int n)
+void PokeGen::PokeMod::PokemonNature::SetNature(const int n)
{
LogSetVar("PokemonNature", id, "nature", n);
nature = n;
@@ -126,7 +126,7 @@ void PokeGen::PokeMod::PokemonNature::SetNature(const String &n)
nature = temp->GetId();
}
-void PokeGen::PokeMod::PokemonNature::SetWeight(unsigned w)
+void PokeGen::PokeMod::PokemonNature::SetWeight(const unsigned w)
{
LogSetVar("PokemonNature", id, "weight", w, GetNatureString());
if (w)
diff --git a/pokemod/PokemonNature.h b/pokemod/PokemonNature.h
index 7d0c6c56..d7724be6 100644
--- a/pokemod/PokemonNature.h
+++ b/pokemod/PokemonNature.h
@@ -35,16 +35,16 @@ namespace PokeGen
class PokemonNature : public Object
{
public:
- PokemonNature(unsigned _id);
- PokemonNature(Ini &ini, unsigned _id = UINT_MAX);
+ PokemonNature(const unsigned _id);
+ PokemonNature(Ini &ini, const unsigned _id = UINT_MAX);
~PokemonNature();
- void ImportIni(Ini &ini, unsigned _id = UINT_MAX);
+ void ImportIni(Ini &ini, const unsigned _id = UINT_MAX);
void ExportIni(std::ofstream &fout, const String &pokemon) const;
- void SetNature(int n);
+ void SetNature(const int n);
void SetNature(const String &n);
- void SetWeight(unsigned w);
+ void SetWeight(const unsigned w);
int GetNature() const;
String GetNatureString() const;
diff --git a/pokemod/Ref.cpp b/pokemod/Ref.cpp
index c91f3922..51d6b49a 100644
--- a/pokemod/Ref.cpp
+++ b/pokemod/Ref.cpp
@@ -23,7 +23,7 @@
#include "Ref.h"
-int PokeGen::PokeMod::FindIn(int end, const String &str, const char *array[])
+int PokeGen::PokeMod::FindIn(const int end, const String &str, const char *array[])
{
int i = 0;
// Loop through looking for where the string is in the array
diff --git a/pokemod/Ref.h b/pokemod/Ref.h
index 7195025d..3efe5aad 100644
--- a/pokemod/Ref.h
+++ b/pokemod/Ref.h
@@ -33,7 +33,7 @@ namespace PokeGen
{
namespace PokeMod
{
- int FindIn(int end, const String &str, const char *array[]);
+ int FindIn(const int end, const String &str, const char *array[]);
enum EnumAbilityEffect
{
diff --git a/pokemod/Store.cpp b/pokemod/Store.cpp
index ca7b2d52..ecbbed31 100644
--- a/pokemod/Store.cpp
+++ b/pokemod/Store.cpp
@@ -25,7 +25,7 @@
extern PokeGen::PokeMod::PokeMod curPokeMod;
-PokeGen::PokeMod::Store::Store(unsigned _id)
+PokeGen::PokeMod::Store::Store(const unsigned _id)
{
LogCtor("Store", _id);
name = "";
@@ -33,7 +33,7 @@ PokeGen::PokeMod::Store::Store(unsigned _id)
id = _id;
}
-PokeGen::PokeMod::Store::Store(Ini &ini, unsigned _id)
+PokeGen::PokeMod::Store::Store(Ini &ini, const unsigned _id)
{
LogCtorIni("Store", _id);
ImportIni(ini, _id);
@@ -67,7 +67,7 @@ void PokeGen::PokeMod::Store::Validate()
}
#ifdef PG_DEBUG_WINDOW
-void PokeGen::PokeMod::Store::Validate(wxListBox &output)
+void PokeGen::PokeMod::Store::Validate(const wxListBox &output)
{
isValid = true;
LogValidateStart("Store", id, name);
@@ -90,7 +90,7 @@ void PokeGen::PokeMod::Store::Validate(wxListBox &output)
}
#endif
-void PokeGen::PokeMod::Store::ImportIni(Ini &ini, unsigned _id)
+void PokeGen::PokeMod::Store::ImportIni(Ini &ini, const unsigned _id)
{
LogImportStart("Store");
if (_id == UINT_MAX)
@@ -142,7 +142,7 @@ PokeGen::PokeMod::String PokeGen::PokeMod::Store::GetName()
return name;
}
-int PokeGen::PokeMod::Store::GetItem(unsigned i) const
+int PokeGen::PokeMod::Store::GetItem(const unsigned i) const
{
LogSubmoduleFetch("Store", id, "item", i, name);
if (GetItemCount() <= i)
@@ -153,7 +153,7 @@ int PokeGen::PokeMod::Store::GetItem(unsigned i) const
return items[i];
}
-bool PokeGen::PokeMod::Store::HasItem(unsigned _id) const
+bool PokeGen::PokeMod::Store::HasItem(const unsigned _id) const
{
LogSubmoduleFetch("Store", id, "item", _id, name);
return (GetItem(_id) != -1);
@@ -177,13 +177,13 @@ unsigned PokeGen::PokeMod::Store::GetItemCount() const
return items.size();
}
-void PokeGen::PokeMod::Store::NewItem(unsigned i)
+void PokeGen::PokeMod::Store::NewItem(const unsigned i)
{
LogSubmoduleNew("Store", id, "item", items.size());
items.push_back(i);
}
-void PokeGen::PokeMod::Store::DeleteItem(unsigned i)
+void PokeGen::PokeMod::Store::DeleteItem(const unsigned i)
{
LogSubmoduleRemoveStart("Store", id, "item", i, name);
if (GetItemCount() <= i)
@@ -192,7 +192,7 @@ void PokeGen::PokeMod::Store::DeleteItem(unsigned i)
DeleteItemByID(items[i]);
}
-void PokeGen::PokeMod::Store::DeleteItemByID(unsigned _id)
+void PokeGen::PokeMod::Store::DeleteItemByID(const unsigned _id)
{
LogSubmoduleRemoveStart("Store", id, "item", _id, name);
for (std::vector<unsigned>::iterator i = items.begin(); i != items.end(); ++i)
diff --git a/pokemod/Store.h b/pokemod/Store.h
index 82676f6e..6c909efe 100644
--- a/pokemod/Store.h
+++ b/pokemod/Store.h
@@ -36,24 +36,24 @@ namespace PokeGen
class Store : public Object
{
public:
- Store(unsigned _id);
- Store(Ini &ini, unsigned _id = UINT_MAX);
+ Store(const unsigned _id);
+ Store(Ini &ini, const unsigned _id = UINT_MAX);
~Store();
- void ImportIni(Ini &ini, unsigned _id = UINT_MAX);
+ void ImportIni(Ini &ini, const unsigned _id = UINT_MAX);
void ExportIni(std::ofstream &fout) const;
void SetName(const String &n);
String GetName();
- int GetItem(unsigned i) const;
- bool HasItem(unsigned _id) const;
+ int GetItem(const unsigned i) const;
+ bool HasItem(const unsigned _id) const;
bool HasItem(const String &n) const;
unsigned GetItemCount() const;
- void NewItem(unsigned i);
- void DeleteItem(unsigned i);
- void DeleteItemByID(unsigned i);
+ void NewItem(const unsigned i);
+ void DeleteItem(const unsigned i);
+ void DeleteItemByID(const unsigned i);
private:
void Validate();
# ifdef PG_DEBUG_WINDOW
diff --git a/pokemod/Time.cpp b/pokemod/Time.cpp
index 453401c7..514d8d3c 100644
--- a/pokemod/Time.cpp
+++ b/pokemod/Time.cpp
@@ -23,7 +23,7 @@
#include "Time.h"
-PokeGen::PokeMod::Time::Time(unsigned _id)
+PokeGen::PokeMod::Time::Time(const unsigned _id)
{
LogCtor("Time", id);
name = "";
@@ -32,7 +32,7 @@ PokeGen::PokeMod::Time::Time(unsigned _id)
id = _id;
}
-PokeGen::PokeMod::Time::Time(Ini &ini, unsigned _id)
+PokeGen::PokeMod::Time::Time(Ini &ini, const unsigned _id)
{
LogCtorIni("Time", _id);
ImportIni(ini, _id);
@@ -94,7 +94,7 @@ void PokeGen::PokeMod::Time::Validate(const wxListBox &output)
}
#endif
-void PokeGen::PokeMod::Time::ImportIni(Ini &ini, unsigned _id)
+void PokeGen::PokeMod::Time::ImportIni(Ini &ini, const unsigned _id)
{
LogImportStart("Time");
if (_id == UINT_MAX)
@@ -131,14 +131,14 @@ void PokeGen::PokeMod::Time::SetName(const String &n)
name = n;
}
-void PokeGen::PokeMod::Time::SetStartHour(unsigned h)
+void PokeGen::PokeMod::Time::SetStartHour(const unsigned h)
{
LogSetVar("Time", id, "startHour", h, name);
if (h < 24)
startHour = h;
}
-void PokeGen::PokeMod::Time::SetStartMinute(unsigned m)
+void PokeGen::PokeMod::Time::SetStartMinute(const unsigned m)
{
LogSetVar("Time", id, "startMinute", m, name);
if (m < 60)
diff --git a/pokemod/Time.h b/pokemod/Time.h
index b577283d..198bf483 100644
--- a/pokemod/Time.h
+++ b/pokemod/Time.h
@@ -34,16 +34,16 @@ namespace PokeGen
class Time : public Object
{
public:
- Time(unsigned _id);
- Time(Ini &ini, unsigned _id = UINT_MAX);
+ Time(const unsigned _id);
+ Time(Ini &ini, const unsigned _id = UINT_MAX);
~Time();
- void ImportIni(Ini &ini, unsigned _id = UINT_MAX);
+ void ImportIni(Ini &ini, const unsigned _id = UINT_MAX);
void ExportIni(std::ofstream &fout) const;
void SetName(const String &n);
- void SetStartHour(unsigned h);
- void SetStartMinute(unsigned m);
+ void SetStartHour(const unsigned h);
+ void SetStartMinute(const unsigned m);
String GetName() const;
unsigned GetStartHour() const;
diff --git a/pokemod/Type.cpp b/pokemod/Type.cpp
index 0e8f55a8..41f0ff57 100644
--- a/pokemod/Type.cpp
+++ b/pokemod/Type.cpp
@@ -23,7 +23,7 @@
#include "Type.h"
-PokeGen::PokeMod::Type::Type(unsigned _id)
+PokeGen::PokeMod::Type::Type(const unsigned _id)
{
LogCtor("Type", _id);
name = "";
@@ -31,7 +31,7 @@ PokeGen::PokeMod::Type::Type(unsigned _id)
id = _id;
}
-PokeGen::PokeMod::Type::Type(Ini &ini, unsigned _id)
+PokeGen::PokeMod::Type::Type(Ini &ini, const unsigned _id)
{
LogCtorIni("Type", _id);
ImportIni(ini, _id);
@@ -71,7 +71,7 @@ void PokeGen::PokeMod::Type::Validate(const wxListBox &output)
}
#endif
-void PokeGen::PokeMod::Type::ImportIni(Ini &ini, unsigned _id)
+void PokeGen::PokeMod::Type::ImportIni(Ini &ini, const unsigned _id)
{
LogImportStart("Type");
String curName;
@@ -106,7 +106,7 @@ void PokeGen::PokeMod::Type::SetName(const String &n)
name = n;
}
-void PokeGen::PokeMod::Type::SetStab(bool s)
+void PokeGen::PokeMod::Type::SetStab(const bool s)
{
LogSetVar("Type", id, "stab", s, name);
stab = s;
diff --git a/pokemod/Type.h b/pokemod/Type.h
index 75dda741..be60aea0 100644
--- a/pokemod/Type.h
+++ b/pokemod/Type.h
@@ -34,15 +34,15 @@ namespace PokeGen
class Type : public Object
{
public:
- Type(unsigned _id);
- Type(Ini &ini, unsigned _id = UINT_MAX);
+ Type(const unsigned _id);
+ Type(Ini &ini, const unsigned _id = UINT_MAX);
~Type();
- void ImportIni(Ini &ini, unsigned _id = UINT_MAX);
+ void ImportIni(Ini &ini, const unsigned _id = UINT_MAX);
void ExportIni(std::ofstream &fout) const;
void SetName(const String &n);
- void SetStab(bool s);
+ void SetStab(const bool s);
String GetName() const;
bool GetStab() const;
diff --git a/pokemodr/gui/egggrouppanel.cpp b/pokemodr/gui/egggrouppanel.cpp
new file mode 100644
index 00000000..832944e9
--- /dev/null
+++ b/pokemodr/gui/egggrouppanel.cpp
@@ -0,0 +1,233 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name: egggrouppanel.cpp
+// Purpose:
+// Author: Ben Boeckel
+// Modified by:
+// Created: 25/05/2007 15:23:20
+// RCS-ID:
+// Copyright: ©2006-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.
+/////////////////////////////////////////////////////////////////////////////
+
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
+#pragma implementation "egggrouppanel.h"
+#endif
+
+// For compilers that support precompilation, includes "wx/wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
+
+#ifndef WX_PRECOMP
+#include "wx/wx.h"
+#endif
+
+////@begin includes
+////@end includes
+
+#include "egggrouppanel.h"
+
+////@begin XPM images
+
+////@end XPM images
+
+/*!
+ * EggGroupPanel type definition
+ */
+
+IMPLEMENT_DYNAMIC_CLASS( EggGroupPanel, wxPanel )
+
+/*!
+ * EggGroupPanel event table definition
+ */
+
+BEGIN_EVENT_TABLE( EggGroupPanel, wxPanel )
+
+////@begin EggGroupPanel event table entries
+ EVT_BUTTON( ID_HIDE_SHOW, EggGroupPanel::OnHideShowClick )
+
+ EVT_BUTTON( ID_DELETE, EggGroupPanel::OnDeleteClick )
+
+ EVT_TEXT( ID_NAME, EggGroupPanel::OnNameUpdated )
+
+////@end EggGroupPanel event table entries
+
+END_EVENT_TABLE()
+
+/*!
+ * EggGroupPanel constructors
+ */
+
+EggGroupPanel::EggGroupPanel()
+{
+ Init();
+}
+
+EggGroupPanel::EggGroupPanel( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
+{
+ Init();
+ Create(parent, id, pos, size, style);
+}
+
+/*!
+ * EggGroupPanel creator
+ */
+
+bool EggGroupPanel::Create( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
+{
+////@begin EggGroupPanel creation
+ wxPanel::Create( parent, id, pos, size, style );
+
+ CreateControls();
+ if (GetSizer())
+ {
+ GetSizer()->SetSizeHints(this);
+ }
+ Centre();
+////@end EggGroupPanel creation
+ return true;
+}
+
+/*!
+ * EggGroupPanel destructor
+ */
+
+EggGroupPanel::~EggGroupPanel()
+{
+////@begin EggGroupPanel destruction
+////@end EggGroupPanel destruction
+}
+
+/*!
+ * Member initialisation
+ */
+
+void EggGroupPanel::Init()
+{
+////@begin EggGroupPanel member initialisation
+ m_Name = NULL;
+////@end EggGroupPanel member initialisation
+}
+
+/*!
+ * Control creation for EggGroupPanel
+ */
+
+void EggGroupPanel::CreateControls()
+{
+////@begin EggGroupPanel content construction
+ EggGroupPanel* itemPanel1 = this;
+
+ wxStaticBox* itemStaticBoxSizer2Static = new wxStaticBox(itemPanel1, wxID_ANY, _T(""));
+ wxStaticBoxSizer* itemStaticBoxSizer2 = new wxStaticBoxSizer(itemStaticBoxSizer2Static, wxVERTICAL);
+ itemPanel1->SetSizer(itemStaticBoxSizer2);
+
+ wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
+ itemStaticBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT, 5);
+
+ wxButton* itemButton4 = new wxButton( itemPanel1, ID_HIDE_SHOW, _("Hide"), wxDefaultPosition, wxDefaultSize, 0 );
+ itemBoxSizer3->Add(itemButton4, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5);
+
+ wxButton* itemButton5 = new wxButton( itemPanel1, ID_DELETE, _("Delete"), wxDefaultPosition, wxDefaultSize, 0 );
+ itemBoxSizer3->Add(itemButton5, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5);
+
+ wxStaticBox* itemStaticBoxSizer6Static = new wxStaticBox(itemPanel1, wxID_ANY, _T(""));
+ wxStaticBoxSizer* itemStaticBoxSizer6 = new wxStaticBoxSizer(itemStaticBoxSizer6Static, wxHORIZONTAL);
+ itemStaticBoxSizer2->Add(itemStaticBoxSizer6, 0, wxGROW, 5);
+
+ wxStaticText* itemStaticText7 = new wxStaticText( itemPanel1, wxID_STATIC, _("Name:"), wxDefaultPosition, wxDefaultSize, 0 );
+ itemStaticBoxSizer6->Add(itemStaticText7, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5);
+
+ itemStaticBoxSizer6->Add(5, 5, 1, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5);
+
+ m_Name = new wxTextCtrl( itemPanel1, ID_NAME, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
+ itemStaticBoxSizer6->Add(m_Name, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5);
+
+////@end EggGroupPanel content construction
+}
+
+/*!
+ * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_HIDE_SHOW
+ */
+
+void EggGroupPanel::OnHideShowClick( wxCommandEvent& event )
+{
+////@begin wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_HIDE_SHOW in EggGroupPanel.
+ // Before editing this code, remove the block markers.
+ event.Skip();
+////@end wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_HIDE_SHOW in EggGroupPanel.
+}
+
+/*!
+ * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_DELETE
+ */
+
+void EggGroupPanel::OnDeleteClick( wxCommandEvent& event )
+{
+////@begin wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_DELETE in EggGroupPanel.
+ // Before editing this code, remove the block markers.
+ event.Skip();
+////@end wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_DELETE in EggGroupPanel.
+}
+
+/*!
+ * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_NAME
+ */
+
+void EggGroupPanel::OnNameUpdated( wxCommandEvent& event )
+{
+////@begin wxEVT_COMMAND_TEXT_UPDATED event handler for ID_NAME in EggGroupPanel.
+ // Before editing this code, remove the block markers.
+ event.Skip();
+////@end wxEVT_COMMAND_TEXT_UPDATED event handler for ID_NAME in EggGroupPanel.
+}
+
+/*!
+ * Should we show tooltips?
+ */
+
+bool EggGroupPanel::ShowToolTips()
+{
+ return true;
+}
+
+/*!
+ * Get bitmap resources
+ */
+
+wxBitmap EggGroupPanel::GetBitmapResource( const wxString& name )
+{
+ // Bitmap retrieval
+////@begin EggGroupPanel bitmap retrieval
+ wxUnusedVar(name);
+ return wxNullBitmap;
+////@end EggGroupPanel bitmap retrieval
+}
+
+/*!
+ * Get icon resources
+ */
+
+wxIcon EggGroupPanel::GetIconResource( const wxString& name )
+{
+ // Icon retrieval
+////@begin EggGroupPanel icon retrieval
+ wxUnusedVar(name);
+ return wxNullIcon;
+////@end EggGroupPanel icon retrieval
+}
diff --git a/pokemodr/gui/egggrouppanel.h b/pokemodr/gui/egggrouppanel.h
new file mode 100644
index 00000000..725608b6
--- /dev/null
+++ b/pokemodr/gui/egggrouppanel.h
@@ -0,0 +1,127 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name: egggrouppanel.h
+// Purpose:
+// Author: Ben Boeckel
+// Modified by:
+// Created: 25/05/2007 15:23:20
+// Copyright: ©2006-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 _EGGGROUPPANEL_H_
+#define _EGGGROUPPANEL_H_
+
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
+#pragma interface "egggrouppanel.h"
+#endif
+
+/*!
+ * Includes
+ */
+
+////@begin includes
+////@end includes
+
+/*!
+ * Forward declarations
+ */
+
+////@begin forward declarations
+////@end forward declarations
+
+/*!
+ * Control identifiers
+ */
+
+////@begin control identifiers
+#define SYMBOL_EGGGROUPPANEL_STYLE 0
+#define SYMBOL_EGGGROUPPANEL_TITLE _("EggGroupPanel")
+#define SYMBOL_EGGGROUPPANEL_IDNAME ID_EGGGROUPPANEL
+#define SYMBOL_EGGGROUPPANEL_SIZE wxSize(400, 300)
+#define SYMBOL_EGGGROUPPANEL_POSITION wxDefaultPosition
+////@end control identifiers
+
+/*!
+ * Compatibility
+ */
+
+#ifndef wxCLOSE_BOX
+#define wxCLOSE_BOX 0x1000
+#endif
+
+/*!
+ * EggGroupPanel class declaration
+ */
+
+class EggGroupPanel: public wxPanel
+{
+ DECLARE_DYNAMIC_CLASS( EggGroupPanel )
+ DECLARE_EVENT_TABLE()
+
+public:
+ /// Constructors
+ EggGroupPanel();
+ EggGroupPanel( wxWindow* parent, wxWindowID id = SYMBOL_EGGGROUPPANEL_IDNAME, const wxPoint& pos = SYMBOL_EGGGROUPPANEL_POSITION, const wxSize& size = SYMBOL_EGGGROUPPANEL_SIZE, long style = SYMBOL_EGGGROUPPANEL_STYLE );
+
+ /// Creation
+ bool Create( wxWindow* parent, wxWindowID id = SYMBOL_EGGGROUPPANEL_IDNAME, const wxPoint& pos = SYMBOL_EGGGROUPPANEL_POSITION, const wxSize& size = SYMBOL_EGGGROUPPANEL_SIZE, long style = SYMBOL_EGGGROUPPANEL_STYLE );
+
+ /// Destructor
+ ~EggGroupPanel();
+
+ /// Initialises member variables
+ void Init();
+
+ /// Creates the controls and sizers
+ void CreateControls();
+
+////@begin EggGroupPanel event handler declarations
+ /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_HIDE_SHOW
+ void OnHideShowClick( wxCommandEvent& event );
+
+ /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_DELETE
+ void OnDeleteClick( wxCommandEvent& event );
+
+ /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_NAME
+ void OnNameUpdated( wxCommandEvent& event );
+
+////@end EggGroupPanel event handler declarations
+
+////@begin EggGroupPanel member function declarations
+ /// Retrieves bitmap resources
+ wxBitmap GetBitmapResource( const wxString& name );
+
+ /// Retrieves icon resources
+ wxIcon GetIconResource( const wxString& name );
+////@end EggGroupPanel member function declarations
+
+ /// Should we show tooltips?
+ static bool ShowToolTips();
+
+////@begin EggGroupPanel member variables
+ wxTextCtrl* m_Name;
+ /// Control identifiers
+ enum {
+ ID_EGGGROUPPANEL = 10444,
+ ID_HIDE_SHOW = 10001,
+ ID_DELETE = 10002,
+ ID_NAME = 10446
+ };
+////@end EggGroupPanel member variables
+};
+
+#endif
+ // _EGGGROUPPANEL_H_