summaryrefslogtreecommitdiffstats
path: root/pokemod/CoinList.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2007-06-02 18:12:48 +0000
committerBen Boeckel <MathStuf@gmail.com>2007-06-02 18:12:48 +0000
commitc9afda3ab74614fb36986f96b7972c082f275eca (patch)
tree1b7c0b31950597d6ed562d94158dd3f8701496da /pokemod/CoinList.cpp
parentf71140fae5218ee9839ffcd4ec83abfded5124f4 (diff)
downloadsigen-c9afda3ab74614fb36986f96b7972c082f275eca.tar.gz
sigen-c9afda3ab74614fb36986f96b7972c082f275eca.tar.xz
sigen-c9afda3ab74614fb36986f96b7972c082f275eca.zip
Finished off all PokeMod classes, added move validations, fixed up some GUI, various other fixes
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@18 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemod/CoinList.cpp')
-rw-r--r--pokemod/CoinList.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/pokemod/CoinList.cpp b/pokemod/CoinList.cpp
index becd28f8..08bc019d 100644
--- a/pokemod/CoinList.cpp
+++ b/pokemod/CoinList.cpp
@@ -26,12 +26,11 @@
extern PokeGen::PokeMod::Pokemod curPokeMod;
-PokeGen::PokeMod::CoinList::CoinList(const unsigned _id)
+PokeGen::PokeMod::CoinList::CoinList(const unsigned _id) :
+ name(""),
+ value(0)
{
LogCtor("CoinList", _id);
- name = "";
- value = 0;
- items.clear();
id = _id;
}
@@ -107,14 +106,14 @@ void PokeGen::PokeMod::CoinList::ImportIni(Ini &ini, const unsigned _id)
LogImportStart("CoinList");
if (_id == UINT_MAX)
{
- ini.GetValue("id", id, UINT_MAX);
+ ini.GetValue("id", id);
// Was there an id associated with the element?
if (id == UINT_MAX)
LogIdNotFound("CoinList");
}
else
id = _id;
- ini.GetValue("name", name, "");
+ ini.GetValue("name", name);
ini.GetValue("value", value, 0);
items.clear();
LogImportOver("CoinList", id, name);
@@ -129,7 +128,7 @@ void PokeGen::PokeMod::CoinList::ExportIni(std::ofstream &fout) const
exCoinList.AddField("name", name);
exCoinList.AddField("value", value);
exCoinList.Export(fout);
- for (std::vector<CoinItem>::iterator i = items.begin(); i != items.end(); ++i)
+ for (std::vector<CoinItem>::const_iterator i = items.begin(); i != items.end(); ++i)
i->ExportIni(fout, name);
LogExportOver("CoinList", id, name);
}
@@ -207,7 +206,7 @@ void PokeGen::PokeMod::CoinList::NewCoinItem(Ini *const ini)
void PokeGen::PokeMod::CoinList::DeleteCoinItem(const unsigned _id)
{
LogSubmoduleRemoveStart("CoinList", id, "item", _id, name);
- for (std::vector<CoinItem>::const_iterator i = items.begin(); i != items.end(); ++i)
+ for (std::vector<CoinItem>::iterator i = items.begin(); i != items.end(); ++i)
{
if (i->GetId() == _id)
{
@@ -221,7 +220,7 @@ void PokeGen::PokeMod::CoinList::DeleteCoinItem(const unsigned _id)
void PokeGen::PokeMod::CoinList::DeleteCoinItem(const String &n)
{
LogSubmoduleRemoveStart("CoinList", id, "item", n, name);
- for (std::vector<CoinItem>::const_iterator i = items.begin(); i != items.end(); ++i)
+ for (std::vector<CoinItem>::iterator i = items.begin(); i != items.end(); ++i)
{
if (i->GetObjectString() == n)
{