summaryrefslogtreecommitdiffstats
path: root/pokemod/Store.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/Store.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/Store.cpp')
-rw-r--r--pokemod/Store.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/pokemod/Store.cpp b/pokemod/Store.cpp
index 7f5936c2..5d75ac37 100644
--- a/pokemod/Store.cpp
+++ b/pokemod/Store.cpp
@@ -25,11 +25,10 @@
extern PokeGen::PokeMod::Pokemod curPokeMod;
-PokeGen::PokeMod::Store::Store(const unsigned _id)
+PokeGen::PokeMod::Store::Store(const unsigned _id) :
+ name("")
{
LogCtor("Store", _id);
- name = "";
- items.clear();
id = _id;
}
@@ -93,7 +92,7 @@ void PokeGen::PokeMod::Store::ImportIni(Ini &ini, const unsigned _id)
LogImportStart("Store");
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("Store");
@@ -180,11 +179,11 @@ void PokeGen::PokeMod::Store::NewItem(const unsigned i)
items.push_back(i);
}
-void PokeGen::PokeMod::Store::NewItem(const String &i)
+void PokeGen::PokeMod::Store::NewItem(const String &n)
{
- LogSubmoduleNew("Store", id, "item", i);
- if (Item *temp = curPokeMod.GetItem(i))
- items.push_back(temp->GetId());
+ LogSubmoduleNew("Store", id, "item", n);
+ if (const Item *i = curPokeMod.GetItem(n))
+ items.push_back(i->GetId());
}
void PokeGen::PokeMod::Store::DeleteItem(const unsigned i)
@@ -199,7 +198,7 @@ void PokeGen::PokeMod::Store::DeleteItem(const unsigned i)
void PokeGen::PokeMod::Store::DeleteItem(const String &n)
{
LogSubmoduleRemoveStart("Store", id, "item", n, name);
- if (Item *i = curPokeMod.GetItem(n))
+ if (const Item *i = curPokeMod.GetItem(n))
DeleteItemByID(i->GetId());
else
LogSubmoduleRemoveFail("Store", id, "item", n, name);