diff options
60 files changed, 282 insertions, 281 deletions
diff --git a/sigmod/Ability.cpp b/sigmod/Ability.cpp index b42231a5..ea722823 100644 --- a/sigmod/Ability.cpp +++ b/sigmod/Ability.cpp @@ -23,8 +23,8 @@ #include "Ability.h" // Sigmod includes +#include "Game.h" #include "Macros.h" -#include "Sigmod.h" using namespace Sigcore; using namespace Sigmod; @@ -35,7 +35,7 @@ Ability::Ability(const Ability& ability) : *this = ability; } -Ability::Ability(const Sigmod* parent, const int id) : +Ability::Ability(const Game* parent, const int id) : Object(parent, id), m_name(""), m_priority(0), @@ -46,13 +46,13 @@ Ability::Ability(const Sigmod* parent, const int id) : { } -Ability::Ability(const Ability& ability, const Sigmod* parent, const int id) : +Ability::Ability(const Ability& ability, const Game* parent, const int id) : Object(parent, id) { *this = ability; } -Ability::Ability(const QDomElement& xml, const Sigmod* parent, const int id) : +Ability::Ability(const QDomElement& xml, const Game* parent, const int id) : Object(parent, id) { LOAD_ID(); diff --git a/sigmod/Ability.h b/sigmod/Ability.h index d31d88c2..31a6abeb 100644 --- a/sigmod/Ability.h +++ b/sigmod/Ability.h @@ -31,7 +31,7 @@ namespace Sigmod { // Forward declarations -class Sigmod; +class Game; /** * \class Sigmod::Ability Ability.h sigmod/Ability.h @@ -69,7 +69,7 @@ class SIGMOD_EXPORT Ability : public Object * \param parent The parent of the ability. * \param id The id number for the ability. */ - Ability(const Sigmod* parent, const int id); + Ability(const Game* parent, const int id); /** * Data copy constructor. Copies the data from \p ability as a child of \p parent with id \p id. * @@ -77,7 +77,7 @@ class SIGMOD_EXPORT Ability : public Object * \param parent The parent of the ability. * \param id The id number for the ability. */ - Ability(const Ability& ability, const Sigmod* parent, const int id); + Ability(const Ability& ability, const Game* parent, const int id); /** * XML data constructor. * @@ -85,7 +85,7 @@ class SIGMOD_EXPORT Ability : public Object * \param parent The parent of the ability. * \param id The id number for the ability. */ - Ability(const QDomElement& xml, const Sigmod* parent, const int id = -1); + Ability(const QDomElement& xml, const Game* parent, const int id = -1); /** * Check to make sure the ability's values are valid. diff --git a/sigmod/Author.cpp b/sigmod/Author.cpp index 9cccdf90..e0c6e013 100644 --- a/sigmod/Author.cpp +++ b/sigmod/Author.cpp @@ -23,8 +23,8 @@ #include "Author.h" // Sigmod includes +#include "Game.h" #include "Macros.h" -#include "Sigmod.h" // Qt includes #include <QtCore/QRegExp> @@ -37,7 +37,7 @@ Author::Author(const Author& author) : *this = author; } -Author::Author(const Sigmod* parent, const int id) : +Author::Author(const Game* parent, const int id) : Object(parent, id), m_name(""), m_email(""), @@ -45,13 +45,13 @@ Author::Author(const Sigmod* parent, const int id) : { } -Author::Author(const Author& author, const Sigmod* parent, const int id) : +Author::Author(const Author& author, const Game* parent, const int id) : Object(parent, id) { *this = author; } -Author::Author(const QDomElement& xml, const Sigmod* parent, const int id) : +Author::Author(const QDomElement& xml, const Game* parent, const int id) : Object(parent, id) { LOAD_ID(); diff --git a/sigmod/Author.h b/sigmod/Author.h index 3d37bd44..4f0f6f34 100644 --- a/sigmod/Author.h +++ b/sigmod/Author.h @@ -28,7 +28,7 @@ namespace Sigmod { // Forward declarations -class Sigmod; +class Game; /** * \class Sigmod::Author Author.h sigmod/Author.h @@ -53,7 +53,7 @@ class SIGMOD_EXPORT Author : public Object * \param parent The parent of the author. * \param id The id number for the author. */ - Author(const Sigmod* parent, const int id); + Author(const Game* parent, const int id); /** * Data copy constructor. Copies the data from \p author as a child of \p parent and id \p id. * @@ -61,7 +61,7 @@ class SIGMOD_EXPORT Author : public Object * \param parent The parent of the author. * \param id The id number for the author. */ - Author(const Author& author, const Sigmod* parent, const int id); + Author(const Author& author, const Game* parent, const int id); /** * XML data constructor. * @@ -69,7 +69,7 @@ class SIGMOD_EXPORT Author : public Object * \param parent The parent of the author. * \param id The id number for the author. */ - Author(const QDomElement& xml, const Sigmod* parent, const int id = -1); + Author(const QDomElement& xml, const Game* parent, const int id = -1); /** * Check to make sure the author's values are valid. diff --git a/sigmod/Badge.cpp b/sigmod/Badge.cpp index 14b08ed9..5315138f 100644 --- a/sigmod/Badge.cpp +++ b/sigmod/Badge.cpp @@ -23,9 +23,9 @@ #include "Badge.h" // Sigmod includes +#include "Game.h" #include "Macros.h" #include "Rules.h" -#include "Sigmod.h" #include "Sprite.h" using namespace Sigcore; @@ -38,7 +38,7 @@ Badge::Badge(const Badge& badge) : *this = badge; } -Badge::Badge(const Sigmod* parent, const int id) : +Badge::Badge(const Game* parent, const int id) : Object(parent, id), m_name(""), m_face(-1), @@ -50,14 +50,14 @@ Badge::Badge(const Sigmod* parent, const int id) : m_stat[i].set(1, 1); } -Badge::Badge(const Badge& badge, const Sigmod* parent, const int id) : +Badge::Badge(const Badge& badge, const Game* parent, const int id) : Object(parent, id), m_stat(ST_SpecialDefense - ST_Attack + 1) { *this = badge; } -Badge::Badge(const QDomElement& xml, const Sigmod* parent, const int id) : +Badge::Badge(const QDomElement& xml, const Game* parent, const int id) : Object(parent, id), m_stat(ST_SpecialDefense - ST_Attack + 1) { @@ -78,7 +78,7 @@ void Badge::validate() TEST_ARRAY_INDEX_OFF(stat, ST_Attack, ST_Attack); TEST_ARRAY_INDEX_OFF(stat, ST_Defense, ST_Attack); TEST_ARRAY_INDEX_OFF(stat, ST_Speed, ST_Attack); - if (sigmod()->rules()->specialSplit()) + if (game()->rules()->specialSplit()) { TEST_ARRAY_INDEX_OFF(stat, ST_SpecialAttack, ST_Attack); TEST_ARRAY_INDEX_OFF(stat, ST_SpecialDefense, ST_Attack); @@ -122,21 +122,21 @@ GETTER(Badge, int, obey) GETTER_ARRAY(Badge, Fraction, stat, multiplier, Stat, stat, ST_Attack) CHECK(Badge, QString&, name) -CHECK_INDEX(Badge, int, face, sigmod(), sprite) -CHECK_INDEX(Badge, int, badge, sigmod(), sprite) -CHECK_BOUNDS(Badge, int, obey, INT_MIN, sigmod()->rules()->maxLevel()) +CHECK_INDEX(Badge, int, face, game(), sprite) +CHECK_INDEX(Badge, int, badge, game(), sprite) +CHECK_BOUNDS(Badge, int, obey, INT_MIN, game()->rules()->maxLevel()) CHECK_BEGIN_ARRAY(Badge, Fraction&, stat, multiplier, Stat, stat) switch (stat) { case ST_SpecialDefense: - if (sigmod()->rules()->specialSplit()) + if (game()->rules()->specialSplit()) case ST_Attack: case ST_Defense: case ST_Speed: case ST_Special: break; default: - EBOUNDS(stat, "Attack", sigmod()->rules()->specialSplit() ? "SpecialDefense" : "Special"); + EBOUNDS(stat, "Attack", game()->rules()->specialSplit() ? "SpecialDefense" : "Special"); return false; } TBOUNDS(multiplier, 1, INT_MAX) diff --git a/sigmod/Badge.h b/sigmod/Badge.h index 9b2f59f6..c7fd4a61 100644 --- a/sigmod/Badge.h +++ b/sigmod/Badge.h @@ -32,7 +32,7 @@ namespace Sigmod { // Forward declarations -class Sigmod; +class Game; /** * \class Sigmod::Badge Badge.h sigmod/Badge.h @@ -58,7 +58,7 @@ class SIGMOD_EXPORT Badge : public Object * \param parent The parent of the badge. * \param id The id number for the badge. */ - Badge(const Sigmod* parent, const int id); + Badge(const Game* parent, const int id); /** * Data copy constructor. Copies the data from \p badge as a child of \p parent and id \p id. * @@ -66,7 +66,7 @@ class SIGMOD_EXPORT Badge : public Object * \param parent The parent of the badge. * \param id The id number for the badge. */ - Badge(const Badge& badge, const Sigmod* parent, const int id); + Badge(const Badge& badge, const Game* parent, const int id); /** * XML data constructor. * @@ -74,7 +74,7 @@ class SIGMOD_EXPORT Badge : public Object * \param parent The parent of the badge. * \param id The id number for the badge. */ - Badge(const QDomElement& xml, const Sigmod* parent, const int id = -1); + Badge(const QDomElement& xml, const Game* parent, const int id = -1); /** * Check to make sure the badge's values are valid. diff --git a/sigmod/CMakeLists.txt b/sigmod/CMakeLists.txt index 762b5954..561af74f 100644 --- a/sigmod/CMakeLists.txt +++ b/sigmod/CMakeLists.txt @@ -11,6 +11,7 @@ set(sigmod_HEADERS CoinList.h CoinListItem.h EggGroup.h + Game.h Global.h GlobalScript.h Item.h @@ -28,7 +29,6 @@ set(sigmod_HEADERS Nature.h Object.h Rules.h - Sigmod.h Skin.h Sound.h Species.h @@ -50,6 +50,7 @@ set(sigmod_SRCS CoinList.cpp CoinListItem.cpp EggGroup.cpp + Game.cpp GlobalScript.cpp Item.cpp ItemType.cpp @@ -65,7 +66,6 @@ set(sigmod_SRCS Nature.cpp Object.cpp Rules.cpp - Sigmod.cpp Skin.cpp Sound.cpp Species.cpp diff --git a/sigmod/CoinList.cpp b/sigmod/CoinList.cpp index 45a84071..279355f7 100644 --- a/sigmod/CoinList.cpp +++ b/sigmod/CoinList.cpp @@ -24,8 +24,8 @@ // Sigmod includes #include "CoinListItem.h" +#include "Game.h" #include "Macros.h" -#include "Sigmod.h" // Qt includes #include <QtCore/QSet> @@ -39,20 +39,20 @@ CoinList::CoinList(const CoinList& coinList) : *this = coinList; } -CoinList::CoinList(const Sigmod* parent, const int id) : +CoinList::CoinList(const Game* parent, const int id) : Object(parent, id), m_name(""), m_script("", "") { } -CoinList::CoinList(const CoinList& coinList, const Sigmod* parent, const int id) : +CoinList::CoinList(const CoinList& coinList, const Game* parent, const int id) : Object(parent, id) { *this = coinList; } -CoinList::CoinList(const QDomElement& xml, const Sigmod* parent, const int id) : +CoinList::CoinList(const QDomElement& xml, const Game* parent, const int id) : Object(parent, id) { LOAD_ID(); diff --git a/sigmod/CoinList.h b/sigmod/CoinList.h index cac42ad3..2e9f4966 100644 --- a/sigmod/CoinList.h +++ b/sigmod/CoinList.h @@ -35,7 +35,7 @@ namespace Sigmod { // Forward declarations class CoinListItem; -class Sigmod; +class Game; /** * \class Sigmod::CoinList CoinList.h sigmod/CoinList.h @@ -62,7 +62,7 @@ class SIGMOD_EXPORT CoinList : public Object * \param parent The parent of the coin list. * \param id The id number for the coin list. */ - CoinList(const Sigmod* parent, const int id); + CoinList(const Game* parent, const int id); /** * Data copy constructor. Copies the data from \p coinList as a child of \p parent with id \p id. * @@ -70,7 +70,7 @@ class SIGMOD_EXPORT CoinList : public Object * \param parent The parent of the coin list. * \param id The id number for the coin list. */ - CoinList(const CoinList& coinList, const Sigmod* parent, const int id); + CoinList(const CoinList& coinList, const Game* parent, const int id); /** * XML data constructor. * @@ -78,7 +78,7 @@ class SIGMOD_EXPORT CoinList : public Object * \param parent The parent of the coin list. * \param id The id number for the coin list. */ - CoinList(const QDomElement& xml, const Sigmod* parent, const int id = -1); + CoinList(const QDomElement& xml, const Game* parent, const int id = -1); /** * Destructor. */ diff --git a/sigmod/CoinListItem.cpp b/sigmod/CoinListItem.cpp index 16c68067..dffa7155 100644 --- a/sigmod/CoinListItem.cpp +++ b/sigmod/CoinListItem.cpp @@ -24,8 +24,8 @@ // Sigmod includes #include "CoinList.h" +#include "Game.h" #include "Macros.h" -#include "Sigmod.h" using namespace Sigmod; @@ -96,10 +96,10 @@ CHECK_BEGIN(CoinListItem, int, object) switch (m_type) { case Item: - IBOUNDS(object, sigmod(), item) + IBOUNDS(object, game(), item) break; case Species: - IBOUNDS(object, sigmod(), species) + IBOUNDS(object, game(), species) break; } CHECK_END() diff --git a/sigmod/EggGroup.cpp b/sigmod/EggGroup.cpp index d57d980f..eb1d8e21 100644 --- a/sigmod/EggGroup.cpp +++ b/sigmod/EggGroup.cpp @@ -23,8 +23,8 @@ #include "EggGroup.h" // Sigmod includes +#include "Game.h" #include "Macros.h" -#include "Sigmod.h" using namespace Sigmod; @@ -34,19 +34,19 @@ EggGroup::EggGroup(const EggGroup& eggGroup) : *this = eggGroup; } -EggGroup::EggGroup(const Sigmod* parent, const int id) : +EggGroup::EggGroup(const Game* parent, const int id) : Object(parent, id), m_name("") { } -EggGroup::EggGroup(const EggGroup& eggGroup, const Sigmod* parent, const int id) : +EggGroup::EggGroup(const EggGroup& eggGroup, const Game* parent, const int id) : Object(parent, id) { *this = eggGroup; } -EggGroup::EggGroup(const QDomElement& xml, const Sigmod* parent, const int id) : +EggGroup::EggGroup(const QDomElement& xml, const Game* parent, const int id) : Object(parent, id) { LOAD_ID(); diff --git a/sigmod/EggGroup.h b/sigmod/EggGroup.h index b259025a..04f9ff86 100644 --- a/sigmod/EggGroup.h +++ b/sigmod/EggGroup.h @@ -28,7 +28,7 @@ namespace Sigmod { // Forward declarations -class Sigmod; +class Game; /** * \class Sigmod::EggGroup EggGroup.h sigmod/EggGroup.h @@ -51,7 +51,7 @@ class SIGMOD_EXPORT EggGroup : public Object * \param parent The parent of the group. * \param id The id number for the group. */ - EggGroup(const Sigmod* parent, const int id); + EggGroup(const Game* parent, const int id); /** * Data copy constructor. Copies the data from \p eggGroup as a child of \p parent with id \p id. * @@ -59,7 +59,7 @@ class SIGMOD_EXPORT EggGroup : public Object * \param parent The parent of the group. * \param id The id number for the group. */ - EggGroup(const EggGroup& eggGroup, const Sigmod* parent, const int id); + EggGroup(const EggGroup& eggGroup, const Game* parent, const int id); /** * XML data constructor. * @@ -67,7 +67,7 @@ class SIGMOD_EXPORT EggGroup : public Object * \param parent The parent of the group. * \param id The id number for the group. */ - EggGroup(const QDomElement& xml, const Sigmod* parent, const int id = -1); + EggGroup(const QDomElement& xml, const Game* parent, const int id = -1); /** * Check to make sure the group's values are valid. diff --git a/sigmod/Sigmod.cpp b/sigmod/Game.cpp index 8a829be9..8a829be9 100644 --- a/sigmod/Sigmod.cpp +++ b/sigmod/Game.cpp diff --git a/sigmod/Sigmod.h b/sigmod/Game.h index 8140a956..8140a956 100644 --- a/sigmod/Sigmod.h +++ b/sigmod/Game.h diff --git a/sigmod/GlobalScript.cpp b/sigmod/GlobalScript.cpp index c25239f5..e5651121 100644 --- a/sigmod/GlobalScript.cpp +++ b/sigmod/GlobalScript.cpp @@ -23,8 +23,8 @@ #include "GlobalScript.h" // Sigmod includes +#include "Game.h" #include "Macros.h" -#include "Sigmod.h" using namespace Sigcore; using namespace Sigmod; @@ -35,20 +35,20 @@ GlobalScript::GlobalScript(const GlobalScript& globalScript) : *this = globalScript; } -GlobalScript::GlobalScript(const Sigmod* parent, const int id) : +GlobalScript::GlobalScript(const Game* parent, const int id) : Object(parent, id), m_name(""), m_script("", "") { } -GlobalScript::GlobalScript(const GlobalScript& globalScript, const Sigmod* parent, const int id) : +GlobalScript::GlobalScript(const GlobalScript& globalScript, const Game* parent, const int id) : Object(parent, id) { *this = globalScript; } -GlobalScript::GlobalScript(const QDomElement& xml, const Sigmod* parent, const int id) : +GlobalScript::GlobalScript(const QDomElement& xml, const Game* parent, const int id) : Object(parent, id) { LOAD_ID(); diff --git a/sigmod/GlobalScript.h b/sigmod/GlobalScript.h index 97f39eeb..17709db3 100644 --- a/sigmod/GlobalScript.h +++ b/sigmod/GlobalScript.h @@ -31,7 +31,7 @@ namespace Sigmod { // Forward declarations -class Sigmod; +class Game; /** * \class Sigmod::GlobalScript GlobalScript.h sigmod/GlobalScript.h @@ -60,7 +60,7 @@ class SIGMOD_EXPORT GlobalScript : public Object * \param parent The parent of the script. * \param id The id number for the script. */ - GlobalScript(const Sigmod* parent, const int id); + GlobalScript(const Game* parent, const int id); /** * Data copy constructor. Copies the data from \p globalScript as a child of \p parent with id \p id. * @@ -68,7 +68,7 @@ class SIGMOD_EXPORT GlobalScript : public Object * \param parent The parent of the script. * \param id The id number for the script. */ - GlobalScript(const GlobalScript& globalScript, const Sigmod* parent, const int id); + GlobalScript(const GlobalScript& globalScript, const Game* parent, const int id); /** * XML data constructor. * @@ -76,7 +76,7 @@ class SIGMOD_EXPORT GlobalScript : public Object * \param parent The parent of the script. * \param id The id number for the script. */ - GlobalScript(const QDomElement& xml, const Sigmod* parent, const int id = -1); + GlobalScript(const QDomElement& xml, const Game* parent, const int id = -1); /** * Check to make sure the script's values are valid. diff --git a/sigmod/Item.cpp b/sigmod/Item.cpp index 3942a53f..25bc0895 100644 --- a/sigmod/Item.cpp +++ b/sigmod/Item.cpp @@ -23,10 +23,10 @@ #include "Item.h" // Sigmod includes +#include "Game.h" #include "ItemType.h" #include "Macros.h" #include "Rules.h" -#include "Sigmod.h" // Qt includes #include <QtCore/QSet> @@ -40,7 +40,7 @@ Item::Item(const Item& item) : *this = item; } -Item::Item(const Sigmod* parent, const int id) : +Item::Item(const Game* parent, const int id) : Object(parent, id), m_name(""), m_sellable(false), @@ -53,13 +53,13 @@ Item::Item(const Sigmod* parent, const int id) : { } -Item::Item(const Item& item, const Sigmod* parent, const int id) : +Item::Item(const Item& item, const Game* parent, const int id) : Object(parent, id) { *this = item; } -Item::Item(const QDomElement& xml, const Sigmod* parent, const int id) : +Item::Item(const QDomElement& xml, const Game* parent, const int id) : Object(parent, id) { LOAD_ID(); @@ -126,11 +126,11 @@ GETTER(Item, Script, script) CHECK(Item, QString&, name) CHECK(Item, bool, sellable) -CHECK_INDEX(Item, int, type, sigmod(), itemType) -CHECK_BOUNDS(Item, int, price, 1, sigmod()->rules()->maxMoney()) +CHECK_INDEX(Item, int, type, game(), itemType) +CHECK_BOUNDS(Item, int, price, 1, game()->rules()->maxMoney()) CHECK_BOUNDS(Item, int, sellPrice, 0, m_price) CHECK_BEGIN(Item, int, weight) - const ItemType* type = sigmod()->itemTypeById(m_type); + const ItemType* type = game()->itemTypeById(m_type); if (type) TBOUNDS(weight, 0, type->maxWeight()) CHECK_END() diff --git a/sigmod/Item.h b/sigmod/Item.h index f362ad18..df477f10 100644 --- a/sigmod/Item.h +++ b/sigmod/Item.h @@ -31,7 +31,7 @@ namespace Sigmod { // Forward declarations -class Sigmod; +class Game; /** * \class Sigmod::Item Item.h sigmod/Item.h @@ -58,7 +58,7 @@ class SIGMOD_EXPORT Item : public Object * \param parent The parent of the item. * \param id The id number for the item. */ - Item(const Sigmod* parent, const int id); + Item(const Game* parent, const int id); /** * Data copy constructor. Copies the data from \p item as a child of \p parent with id \p id. * @@ -66,7 +66,7 @@ class SIGMOD_EXPORT Item : public Object * \param parent The parent of the item. * \param id The id number for the item. */ - Item(const Item& item, const Sigmod* parent, const int id); + Item(const Item& item, const Game* parent, const int id); /** * XML data constructor. * @@ -74,7 +74,7 @@ class SIGMOD_EXPORT Item : public Object * \param parent The parent of the item. * \param id The id number for the item. */ - Item(const QDomElement& xml, const Sigmod* parent, const int id = -1); + Item(const QDomElement& xml, const Game* parent, const int id = -1); /** * Check to make sure the item's values are valid. diff --git a/sigmod/ItemType.cpp b/sigmod/ItemType.cpp index f537f06e..15349ce6 100644 --- a/sigmod/ItemType.cpp +++ b/sigmod/ItemType.cpp @@ -23,9 +23,9 @@ #include "ItemType.h" // Sigmod includes +#include "Game.h" #include "Macros.h" #include "Rules.h" -#include "Sigmod.h" using namespace Sigmod; @@ -37,7 +37,7 @@ ItemType::ItemType(const ItemType& itemType) : *this = itemType; } -ItemType::ItemType(const Sigmod* parent, const int id) : +ItemType::ItemType(const Game* parent, const int id) : Object(parent, id), m_name(""), m_computer(0), @@ -47,13 +47,13 @@ ItemType::ItemType(const Sigmod* parent, const int id) : { } -ItemType::ItemType(const ItemType& itemType, const Sigmod* parent, const int id) : +ItemType::ItemType(const ItemType& itemType, const Game* parent, const int id) : Object(parent, id) { *this = itemType; } -ItemType::ItemType(const QDomElement& xml, const Sigmod* parent, const int id) : +ItemType::ItemType(const QDomElement& xml, const Game* parent, const int id) : Object(parent, id) { LOAD_ID(); @@ -107,7 +107,7 @@ GETTER(ItemType, ItemType::Count, count) CHECK(ItemType, QString&, name) CHECK_BOUNDS(ItemType, int, computer, -1, INT_MAX) CHECK_BOUNDS(ItemType, int, player, 0, INT_MAX) -CHECK_BOUNDS(ItemType, int, maxWeight, -1, (sigmod()->rules()->maxTotalWeight() == -1) ? INT_MAX : sigmod()->rules()->maxTotalWeight()) +CHECK_BOUNDS(ItemType, int, maxWeight, -1, (game()->rules()->maxTotalWeight() == -1) ? INT_MAX : game()->rules()->maxTotalWeight()) CHECK(ItemType, Count, count) ItemType& ItemType::operator=(const ItemType& rhs) diff --git a/sigmod/ItemType.h b/sigmod/ItemType.h index 28ec6a97..cf5a1051 100644 --- a/sigmod/ItemType.h +++ b/sigmod/ItemType.h @@ -28,7 +28,7 @@ namespace Sigmod { // Forward declarations -class Sigmod; +class Game; /** * \class Sigmod::ItemType ItemType.h sigmod/ItemType.h @@ -67,7 +67,7 @@ class SIGMOD_EXPORT ItemType : public Object * \param parent The parent of the type. * \param id The id number for the type. */ - ItemType(const Sigmod* parent, const int id); + ItemType(const Game* parent, const int id); /** * Data copy constructor. Copies the data from \p itemType as a child of \p parent with id \p id. * @@ -75,7 +75,7 @@ class SIGMOD_EXPORT ItemType : public Object * \param parent The parent of the type. * \param id The id number for the type. */ - ItemType(const ItemType& itemType, const Sigmod* parent, const int id); + ItemType(const ItemType& itemType, const Game* parent, const int id); /** * XML data constructor. * @@ -83,7 +83,7 @@ class SIGMOD_EXPORT ItemType : public Object * \param parent The parent of the type. * \param id The id number for the type. */ - ItemType(const QDomElement& xml, const Sigmod* parent, const int id = -1); + ItemType(const QDomElement& xml, const Game* parent, const int id = -1); /** * Check to make sure the type's values are valid. diff --git a/sigmod/Map.cpp b/sigmod/Map.cpp index 53f6a530..dd85bd67 100644 --- a/sigmod/Map.cpp +++ b/sigmod/Map.cpp @@ -19,13 +19,13 @@ #include "Map.h" // Sigmod includes +#include "Game.h" #include "Macros.h" #include "MapEffect.h" #include "MapTile.h" #include "MapTrainer.h" #include "MapWarp.h" #include "MapWildList.h" -#include "Sigmod.h" // Qt includes #include <QtCore/QSet> @@ -40,7 +40,7 @@ Map::Map(const Map& map) : *this = map; } -Map::Map(const Sigmod* parent, const int id) : +Map::Map(const Game* parent, const int id) : Object(parent, id), m_name(""), m_type(Outdoor), @@ -49,13 +49,13 @@ Map::Map(const Sigmod* parent, const int id) : { } -Map::Map(const Map& map, const Sigmod* parent, const int id) : +Map::Map(const Map& map, const Game* parent, const int id) : Object(parent, id) { *this = map; } -Map::Map(const QDomElement& xml, const Sigmod* parent, const int id) : +Map::Map(const QDomElement& xml, const Game* parent, const int id) : Object(parent, id) { LOAD_ID(); diff --git a/sigmod/Map.h b/sigmod/Map.h index bc45e116..7b8edab0 100644 --- a/sigmod/Map.h +++ b/sigmod/Map.h @@ -30,12 +30,12 @@ namespace Sigmod { // Forward declarations +class Game; class MapEffect; class MapTile; class MapTrainer; class MapWarp; class MapWildList; -class Sigmod; class SIGMOD_EXPORT Map : public Object { @@ -52,9 +52,9 @@ class SIGMOD_EXPORT Map : public Object static const QStringList TypeStr; Map(const Map& map); - Map(const Sigmod* parent, const int id); - Map(const Map& map, const Sigmod* parent, const int id); - Map(const QDomElement& xml, const Sigmod* parent, const int id = -1); + Map(const Game* parent, const int id); + Map(const Map& map, const Game* parent, const int id); + Map(const QDomElement& xml, const Game* parent, const int id = -1); ~Map(); void validate(); diff --git a/sigmod/MapEffect.cpp b/sigmod/MapEffect.cpp index 3a4fe85e..061780ca 100644 --- a/sigmod/MapEffect.cpp +++ b/sigmod/MapEffect.cpp @@ -23,9 +23,9 @@ #include "MapEffect.h" // Sigmod includes +#include "Game.h" #include "Macros.h" #include "Map.h" -#include "Sigmod.h" using namespace Sigcore; using namespace Sigmod; @@ -108,7 +108,7 @@ CHECK_BEGIN(MapEffect, QPoint&, position) TBOUNDS_MOD(position_x, 0, map->width() - 1, position.x()) TBOUNDS_MOD(position_y, 0, map->height() - 1, position.y()) CHECK_END() -CHECK_INDEX(MapEffect, int, skin, sigmod(), skin) +CHECK_INDEX(MapEffect, int, skin, game(), skin) CHECK(MapEffect, bool, isGhost) CHECK(MapEffect, Script&, script) diff --git a/sigmod/MapTile.cpp b/sigmod/MapTile.cpp index 769e2851..8a1507ab 100644 --- a/sigmod/MapTile.cpp +++ b/sigmod/MapTile.cpp @@ -23,9 +23,9 @@ #include "MapTile.h" // Sigmod includes +#include "Game.h" #include "Macros.h" #include "Map.h" -#include "Sigmod.h" #include "Tile.h" using namespace Sigmod; @@ -90,7 +90,7 @@ GETTER(MapTile, int, tile) GETTER(MapTile, QPoint, position) GETTER(MapTile, int, zIndex) -CHECK_INDEX(MapTile, int, tile, sigmod(), tile) +CHECK_INDEX(MapTile, int, tile, game(), tile) CHECK_BEGIN(MapTile, QPoint&, position) const Map* map = qobject_cast<const Map*>(parent()); TBOUNDS_MOD(position_x, 0, map->width() - 1, position.x()) diff --git a/sigmod/MapTile.h b/sigmod/MapTile.h index 30cadf61..1eb0035b 100644 --- a/sigmod/MapTile.h +++ b/sigmod/MapTile.h @@ -27,6 +27,8 @@ namespace Sigmod { +class Map; + /** * \class Sigmod::MapTile MapTile.h sigmod/MapTile.h * \brief Class describing a tile on a map. diff --git a/sigmod/MapTrainer.cpp b/sigmod/MapTrainer.cpp index 37cf4f4b..d97bea29 100644 --- a/sigmod/MapTrainer.cpp +++ b/sigmod/MapTrainer.cpp @@ -19,11 +19,11 @@ #include "MapTrainer.h" // Sigmod includes +#include "Game.h" #include "Macros.h" #include "Map.h" #include "MapTrainerTeamMember.h" #include "Rules.h" -#include "Sigmod.h" // Qt includes #include <QtCore/QSet> @@ -128,13 +128,13 @@ GETTER(MapTrainer, Script, script) GETTER_LIST(MapTrainer, leadTeamMember) CHECK(MapTrainer, QString&, name) -CHECK_INDEX(MapTrainer, int, trainerClass, sigmod(), trainer) +CHECK_INDEX(MapTrainer, int, trainerClass, game(), trainer) CHECK_BEGIN(MapTrainer, QPoint&, position) const Map* map = qobject_cast<const Map*>(parent()); TBOUNDS_MOD(position_x, 0, map->width() - 1, position.x()) TBOUNDS_MOD(position_y, 0, map->height() - 1, position.y()) CHECK_END() -CHECK_BOUNDS(MapTrainer, int, numberFight, 1, sigmod()->rules()->maxFight()) +CHECK_BOUNDS(MapTrainer, int, numberFight, 1, game()->rules()->maxFight()) CHECK(MapTrainer, Script&, script) CHECK_BEGIN(MapTrainer, int, leadTeamMember) if (!teamMemberById(leadTeamMember)) diff --git a/sigmod/MapTrainerTeamMember.cpp b/sigmod/MapTrainerTeamMember.cpp index eefc0c62..ac49965f 100644 --- a/sigmod/MapTrainerTeamMember.cpp +++ b/sigmod/MapTrainerTeamMember.cpp @@ -23,11 +23,11 @@ #include "MapTrainerTeamMember.h" // Sigmod includes +#include "Game.h" #include "Item.h" #include "Macros.h" #include "MapTrainer.h" #include "Rules.h" -#include "Sigmod.h" #include "Species.h" #include "SpeciesMove.h" @@ -67,19 +67,19 @@ void MapTrainerTeamMember::validate() TEST_BEGIN(); TEST(species); TEST(level); - if (sigmod()->rules()->maxAbilities() < m_ability.size()) + if (game()->rules()->maxAbilities() < m_ability.size()) emit(error("Too many abilities")); TEST_LIST(ability); - if (sigmod()->rules()->maxHeldItems() < m_item.size()) + if (game()->rules()->maxHeldItems() < m_item.size()) emit(error("Too many held items")); TEST_MAP(item); - const Species* species = sigmod()->speciesById(m_species); + const Species* species = game()->speciesById(m_species); if (species && ((species->maxHoldWeight() < heldWeight()))) emit(error("Cannot carry that much weight")); - if (sigmod()->rules()->maxMoves() < m_move.size()) + if (game()->rules()->maxMoves() < m_move.size()) emit(error("Too many moves")); TEST_LIST(move); - if (sigmod()->rules()->maxNatures() < m_nature.size()) + if (game()->rules()->maxNatures() < m_nature.size()) emit(error("Too many natures")); TEST_LIST(nature); TEST_END(); @@ -110,7 +110,7 @@ QDomElement MapTrainerTeamMember::save() const SETTER(MapTrainerTeamMember, int, Species, species) SETTER(MapTrainerTeamMember, int, Level, level) -SETTER_LIST_LIMIT(MapTrainerTeamMember, Ability, ability, sigmod()->rules()->maxAbilities(), "Cannot have anymore abilities") +SETTER_LIST_LIMIT(MapTrainerTeamMember, Ability, ability, game()->rules()->maxAbilities(), "Cannot have anymore abilities") void MapTrainerTeamMember::setItem(const int item, const int count) { @@ -124,7 +124,7 @@ void MapTrainerTeamMember::setItem(const int item, const int count) continue; total += m_item[itemCount]; } - if (total <= sigmod()->rules()->maxHeldItems()) + if (total <= game()->rules()->maxHeldItems()) { if (checkWeight(item, count)) { @@ -144,8 +144,8 @@ void MapTrainerTeamMember::setItem(const int item, const int count) } } -SETTER_LIST_LIMIT(MapTrainerTeamMember, Move, move, sigmod()->rules()->maxMoves(), "Cannot know anymore moves") -SETTER_LIST_LIMIT(MapTrainerTeamMember, Nature, nature, sigmod()->rules()->maxNatures(), "Cannot have anymore natures") +SETTER_LIST_LIMIT(MapTrainerTeamMember, Move, move, game()->rules()->maxMoves(), "Cannot know anymore moves") +SETTER_LIST_LIMIT(MapTrainerTeamMember, Nature, nature, game()->rules()->maxNatures(), "Cannot have anymore natures") GETTER(MapTrainerTeamMember, int, species) GETTER(MapTrainerTeamMember, int, level) @@ -154,22 +154,22 @@ GETTER_MAP(MapTrainerTeamMember, item) GETTER_LIST(MapTrainerTeamMember, move) GETTER_LIST(MapTrainerTeamMember, nature) -CHECK_INDEX(MapTrainerTeamMember, int, species, sigmod(), species) -CHECK_BOUNDS(MapTrainerTeamMember, int, level, 1, sigmod()->rules()->maxLevel()) -CHECK_INDEX(MapTrainerTeamMember, int, ability, sigmod(), ability) +CHECK_INDEX(MapTrainerTeamMember, int, species, game(), species) +CHECK_BOUNDS(MapTrainerTeamMember, int, level, 1, game()->rules()->maxLevel()) +CHECK_INDEX(MapTrainerTeamMember, int, ability, game(), ability) CHECK_BEGIN_ARRAY(MapTrainerTeamMember, int, item, count, int, item) - IBOUNDS(item, sigmod(), item); - TBOUNDS_MOD(item_count, 0, sigmod()->rules()->maxHeldItems(), count) + IBOUNDS(item, game(), item); + TBOUNDS_MOD(item_count, 0, game()->rules()->maxHeldItems(), count) CHECK_END() CHECK_BEGIN(MapTrainerTeamMember, int, move) - IBOUNDS(move, sigmod(), move); + IBOUNDS(move, game(), move); if (!canLearn(move)) { ERROR("Cannot learn the move"); return false; } CHECK_END() -CHECK_INDEX(MapTrainerTeamMember, int, nature, sigmod(), nature) +CHECK_INDEX(MapTrainerTeamMember, int, nature, game(), nature) MapTrainerTeamMember& MapTrainerTeamMember::operator=(const MapTrainerTeamMember& rhs) { @@ -192,7 +192,7 @@ int MapTrainerTeamMember::heldWeight(const QMap<int, int>& items) const QList<int> itemIds = itemsToCheck.keys(); foreach (int itemId, itemIds) { - const Item* item = sigmod()->itemById(itemId); + const Item* item = game()->itemById(itemId); if (item) totalWeight += itemsToCheck[itemId] * item->weight(); } @@ -201,7 +201,7 @@ int MapTrainerTeamMember::heldWeight(const QMap<int, int>& items) const bool MapTrainerTeamMember::checkWeight(const int item, const int count) const { - const Species* species = sigmod()->speciesById(m_species); + const Species* species = game()->speciesById(m_species); if (!species) return true; QMap<int, int> temp = m_item; @@ -211,7 +211,7 @@ bool MapTrainerTeamMember::checkWeight(const int item, const int count) const bool MapTrainerTeamMember::canLearn(const int move) const { - const Species* species = sigmod()->speciesById(m_species); + const Species* species = game()->speciesById(m_species); if (species) { for (int i = 0; i < species->moveCount(); ++i) diff --git a/sigmod/MapWarp.cpp b/sigmod/MapWarp.cpp index a251e834..545e63a0 100644 --- a/sigmod/MapWarp.cpp +++ b/sigmod/MapWarp.cpp @@ -23,9 +23,9 @@ #include "MapWarp.h" // Sigmod includes +#include "Game.h" #include "Macros.h" #include "Map.h" -#include "Sigmod.h" using namespace Sigcore; using namespace Sigmod; @@ -119,9 +119,9 @@ CHECK_BEGIN(MapWarp, QRect&, area) TBOUNDS_MOD(area_height, 1, map->height() - area.y(), area.height()); CHECK_END() CHECK(MapWarp, Type, type) -CHECK_INDEX(MapWarp, int, toMap, sigmod(), map) +CHECK_INDEX(MapWarp, int, toMap, game(), map) CHECK_BEGIN(MapWarp, int, toWarp) - const Map* map = sigmod()->mapById(m_toMap); + const Map* map = game()->mapById(m_toMap); if (!map) { EBOUNDS_IDX(m_toMap); diff --git a/sigmod/MapWildListEncounter.cpp b/sigmod/MapWildListEncounter.cpp index fb9510ad..d0153853 100644 --- a/sigmod/MapWildListEncounter.cpp +++ b/sigmod/MapWildListEncounter.cpp @@ -23,10 +23,10 @@ #include "MapWildListEncounter.h" // Sigmod includes +#include "Game.h" #include "Macros.h" #include "MapWildList.h" #include "Rules.h" -#include "Sigmod.h" #include "Species.h" using namespace Sigmod; @@ -92,8 +92,8 @@ GETTER(MapWildListEncounter, int, species) GETTER(MapWildListEncounter, int, level) GETTER(MapWildListEncounter, int, weight) -CHECK_INDEX(MapWildListEncounter, int, species, sigmod(), species) -CHECK_BOUNDS(MapWildListEncounter, int, level, 1, sigmod()->rules()->maxLevel()) +CHECK_INDEX(MapWildListEncounter, int, species, game(), species) +CHECK_BOUNDS(MapWildListEncounter, int, level, 1, game()->rules()->maxLevel()) CHECK_BOUNDS(MapWildListEncounter, int, weight, 1, INT_MAX) MapWildListEncounter& MapWildListEncounter::operator=(const MapWildListEncounter& rhs) diff --git a/sigmod/Move.cpp b/sigmod/Move.cpp index 40e79999..42832c12 100644 --- a/sigmod/Move.cpp +++ b/sigmod/Move.cpp @@ -23,8 +23,8 @@ #include "Move.h" // Sigmod includes +#include "Game.h" #include "Macros.h" -#include "Sigmod.h" // Qt includes #include <QtCore/QSet> @@ -38,7 +38,7 @@ Move::Move(const Move& move) : *this = move; } -Move::Move(const Sigmod* parent, const int id) : +Move::Move(const Game* parent, const int id) : Object(parent, id), m_name(""), m_accuracy(1, 1), @@ -54,13 +54,13 @@ Move::Move(const Sigmod* parent, const int id) : { } -Move::Move(const Move& move, const Sigmod* parent, const int id) : +Move::Move(const Move& move, const Game* parent, const int id) : Object(parent, id) { *this = move; } -Move::Move(const QDomElement& xml, const Sigmod* parent, const int id) : +Move::Move(const QDomElement& xml, const Game* parent, const int id) : Object(parent, id) { LOAD_ID(); @@ -142,7 +142,7 @@ CHECK_BEGIN(Move, Fraction&, accuracy) TBOUNDS_MOD(accuracy, 1, INT_MAX, accuracy.numerator()); CHECK_END() CHECK_BOUNDS(Move, int, power, 0, INT_MAX) -CHECK_INDEX(Move, int, type, sigmod(), type) +CHECK_INDEX(Move, int, type, game(), type) CHECK(Move, bool, special) CHECK_BOUNDS(Move, int, powerPoints, 1, INT_MAX) CHECK(Move, int, priority) diff --git a/sigmod/Move.h b/sigmod/Move.h index 10adb170..29cf5e9f 100644 --- a/sigmod/Move.h +++ b/sigmod/Move.h @@ -32,7 +32,7 @@ namespace Sigmod { // Forward declarations -class Sigmod; +class Game; /** * \class Sigmod::Move Move.h sigmod/Move.h @@ -58,7 +58,7 @@ class SIGMOD_EXPORT Move : public Object * \param parent The parent of the move. * \param id The id number for the move. */ - Move(const Sigmod* parent, const int id); + Move(const Game* parent, const int id); /** * Data copy constructor. Copies the data from \p move as a child of \p parent with id \p id. * @@ -66,7 +66,7 @@ class SIGMOD_EXPORT Move : public Object * \param parent The parent of the move. * \param id The id number for the move. */ - Move(const Move& move, const Sigmod* parent, const int id); + Move(const Move& move, const Game* parent, const int id); /** * XML data constructor. * @@ -74,7 +74,7 @@ class SIGMOD_EXPORT Move : public Object * \param parent The parent of the move. * \param id The id number for the move. */ - Move(const QDomElement& xml, const Sigmod* parent, const int id = -1); + Move(const QDomElement& xml, const Game* parent, const int id = -1); /** * Check to make sure the move's values are valid. diff --git a/sigmod/Nature.cpp b/sigmod/Nature.cpp index ab98d01e..6f515683 100644 --- a/sigmod/Nature.cpp +++ b/sigmod/Nature.cpp @@ -23,9 +23,9 @@ #include "Nature.h" // Sigmod includes +#include "Game.h" #include "Macros.h" #include "Rules.h" -#include "Sigmod.h" using namespace Sigcore; using namespace Sigmod; @@ -37,7 +37,7 @@ Nature::Nature(const Nature& nature) : *this = nature; } -Nature::Nature(const Sigmod* parent, const int id) : +Nature::Nature(const Game* parent, const int id) : Object(parent, id), m_name(""), m_stat(ST_SpecialDefense - ST_Attack + 1), @@ -47,14 +47,14 @@ Nature::Nature(const Sigmod* parent, const int id) : m_stat[i].set(1, 1); } -Nature::Nature(const Nature& nature, const Sigmod* parent, const int id) : +Nature::Nature(const Nature& nature, const Game* parent, const int id) : Object(parent, id), m_stat(ST_SpecialDefense - ST_Attack + 1) { *this = nature; } -Nature::Nature(const QDomElement& xml, const Sigmod* parent, const int id) : +Nature::Nature(const QDomElement& xml, const Game* parent, const int id) : Object(parent, id), m_stat(ST_SpecialDefense - ST_Attack + 1) { @@ -70,7 +70,7 @@ void Nature::validate() TEST_ARRAY_INDEX_OFF(stat, ST_Attack, ST_Attack); TEST_ARRAY_INDEX_OFF(stat, ST_Defense, ST_Attack); TEST_ARRAY_INDEX_OFF(stat, ST_Speed, ST_Attack); - if (sigmod()->rules()->specialSplit()) + if (game()->rules()->specialSplit()) { TEST_ARRAY_INDEX_OFF(stat, ST_SpecialAttack, ST_Attack); TEST_ARRAY_INDEX_OFF(stat, ST_SpecialDefense, ST_Attack); @@ -111,14 +111,14 @@ CHECK_BEGIN_ARRAY(Nature, Fraction&, stat, multiplier, Stat, stat) switch (stat) { case ST_SpecialDefense: - if (sigmod()->rules()->specialSplit()) + if (game()->rules()->specialSplit()) case ST_Attack: case ST_Defense: case ST_Speed: case ST_Special: break; default: - EBOUNDS(stat, "Attack", sigmod()->rules()->specialSplit() ? "SpecialDefense" : "Special"); + EBOUNDS(stat, "Attack", game()->rules()->specialSplit() ? "SpecialDefense" : "Special"); return false; } TBOUNDS(multiplier, 0, INT_MAX) diff --git a/sigmod/Nature.h b/sigmod/Nature.h index a2215832..540c49e0 100644 --- a/sigmod/Nature.h +++ b/sigmod/Nature.h @@ -32,7 +32,7 @@ namespace Sigmod { // Forward declarations -class Sigmod; +class Game; /** * \class Sigmod::Nature Nature.h sigmod/Nature.h @@ -58,7 +58,7 @@ class SIGMOD_EXPORT Nature : public Object * \param parent The parent of the badge. * \param id The id number for the badge. */ - Nature(const Sigmod* parent, const int id); + Nature(const Game* parent, const int id); /** * Data copy constructor. Copies the data from \p badge as a child of \p parent and id \p id. * @@ -66,7 +66,7 @@ class SIGMOD_EXPORT Nature : public Object * \param parent The parent of the badge. * \param id The id number for the badge. */ - Nature(const Nature& nature, const Sigmod* parent, const int id); + Nature(const Nature& nature, const Game* parent, const int id); /** * XML data constructor. * @@ -74,7 +74,7 @@ class SIGMOD_EXPORT Nature : public Object * \param parent The parent of the badge. * \param id The id number for the badge. */ - Nature(const QDomElement& xml, const Sigmod* parent, const int id = -1); + Nature(const QDomElement& xml, const Game* parent, const int id = -1); /** * Check to make sure the badge's values are valid. diff --git a/sigmod/Object.cpp b/sigmod/Object.cpp index 770d7abf..ac77978f 100644 --- a/sigmod/Object.cpp +++ b/sigmod/Object.cpp @@ -23,6 +23,7 @@ #include "Object.h" // Sigmod includes +#include "Game.h" #include "Macros.h" using namespace Sigcore; @@ -44,11 +45,11 @@ const Object* Object::parent() const return m_parent; } -const Sigmod* Object::sigmod() const +const Game* Object::game() const { if (m_parent) - return m_parent->sigmod(); - return qobject_cast<const Sigmod*>(this); + return m_parent->game(); + return qobject_cast<const Game*>(this); } GETTER(Object, int, id) diff --git a/sigmod/Object.h b/sigmod/Object.h index e5d47e07..aed7b013 100644 --- a/sigmod/Object.h +++ b/sigmod/Object.h @@ -46,16 +46,17 @@ namespace Sigmod { // Forward decarations -class Sigmod; +class Game; /** * \class Sigmod::Object Object.h sigmod/Object.h - * \brief Base class for all data structures in a Sigmod. + * \brief Base class for all data structures in a game. * - * The Object class sets up a parenting structure for all Sigmod classes. It also provides an interface for validation, - * saving to XML format, as well as loading from XML. + * The Object class sets up a parenting structure for all Sigmod classes. + * It also provides an interface for validation, saving to XML format, + * as well as loading from XML. */ -class SIGMOD_EXPORT Object : public QObject +class SIGMOD_IMPORT Object : public QObject { Q_OBJECT @@ -77,9 +78,9 @@ class SIGMOD_EXPORT Object : public QObject */ const Object* parent() const; /** - * \return The Sigmod that the object belongs to. + * \return The game that the object belongs to. */ - const Sigmod* sigmod() const; + const Game* game() const; /** * \return The id of the object. @@ -124,13 +125,13 @@ class SIGMOD_EXPORT Object : public QObject void valMessage(const QString& message) const; /** * Signal for when the object encounters a value that is either confusing or not advised, but does not - * render the Sigmod as inconsistent. + * render the game as inconsistent. * * \param message The warning. */ void valWarning(const QString& message) const; /** - * Signal for when the object encounters an unexpected value that introduces an inconsistency in the Sigmod. + * Signal for when the object encounters an unexpected value that introduces an inconsistency in the game. * * \param message The error. */ @@ -405,7 +406,4 @@ template<typename T> inline QDomElement saveMatrix(const QString& name, const Si } -// This makes the moc file happy. -#include "Sigmod.h" - #endif diff --git a/sigmod/Rules.cpp b/sigmod/Rules.cpp index 15b3846b..66055eb7 100644 --- a/sigmod/Rules.cpp +++ b/sigmod/Rules.cpp @@ -19,8 +19,8 @@ #include "Rules.h" // Sigmod includes +#include "Game.h" #include "Macros.h" -#include "Sigmod.h" using namespace Sigmod; @@ -32,7 +32,7 @@ Rules::Rules(const Rules& rules) : *this = rules; } -Rules::Rules(const Sigmod* parent) : +Rules::Rules(const Game* parent) : Object(parent, 0), m_genderAllowed(false), m_breedingAllowed(false), @@ -60,13 +60,13 @@ Rules::Rules(const Sigmod* parent) : { } -Rules::Rules(const Rules& rules, const Sigmod* parent) : +Rules::Rules(const Rules& rules, const Game* parent) : Object(parent, 0) { *this = rules; } -Rules::Rules(const QDomElement& xml, const Sigmod* parent) : +Rules::Rules(const QDomElement& xml, const Game* parent) : Object(parent, 0) { load(xml); diff --git a/sigmod/Rules.h b/sigmod/Rules.h index 8c479ed6..34fe1847 100644 --- a/sigmod/Rules.h +++ b/sigmod/Rules.h @@ -24,7 +24,7 @@ namespace Sigmod { // Forward declarations -class Sigmod; +class Game; class SIGMOD_EXPORT Rules : public Object { @@ -34,9 +34,9 @@ class SIGMOD_EXPORT Rules : public Object static const QStringList DVStr; Rules(const Rules& rules); - Rules(const Sigmod* parent); - Rules(const Rules& rules, const Sigmod* parent); - Rules(const QDomElement& xml, const Sigmod* parent); + Rules(const Game* parent); + Rules(const Rules& rules, const Game* parent); + Rules(const QDomElement& xml, const Game* parent); void validate(); diff --git a/sigmod/Skin.cpp b/sigmod/Skin.cpp index ee6b00c4..8dd1c1c0 100644 --- a/sigmod/Skin.cpp +++ b/sigmod/Skin.cpp @@ -23,8 +23,8 @@ #include "Skin.h" // Sigmod includes +#include "Game.h" #include "Macros.h" -#include "Sigmod.h" using namespace Sigcore; using namespace Sigmod; @@ -35,20 +35,20 @@ Skin::Skin(const Skin& skin) : *this = skin; } -Skin::Skin(const Sigmod* parent, const int id) : +Skin::Skin(const Game* parent, const int id) : Object(parent, id), m_name(""), m_script("", "") { } -Skin::Skin(const Skin& skin, const Sigmod* parent, const int id) : +Skin::Skin(const Skin& skin, const Game* parent, const int id) : Object(parent, id) { *this = skin; } -Skin::Skin(const QDomElement& xml, const Sigmod* parent, const int id) : +Skin::Skin(const QDomElement& xml, const Game* parent, const int id) : Object(parent, id) { LOAD_ID(); diff --git a/sigmod/Skin.h b/sigmod/Skin.h index 96a556a0..e2394b1b 100644 --- a/sigmod/Skin.h +++ b/sigmod/Skin.h @@ -31,7 +31,7 @@ namespace Sigmod { // Forward declarations -class Sigmod; +class Game; /** * \class Sigmod::Skin Skin.h sigmod/Skin.h @@ -56,7 +56,7 @@ class SIGMOD_EXPORT Skin : public Object * \param parent The parent of the skin. * \param id The id number for the skin. */ - Skin(const Sigmod* parent, const int id); + Skin(const Game* parent, const int id); /** * Data copy constructor. Copies the data from \p skin as a child of \p parent with id \p id. * @@ -64,7 +64,7 @@ class SIGMOD_EXPORT Skin : public Object * \param parent The parent of the skin. * \param id The id number for the skin. */ - Skin(const Skin& skin, const Sigmod* parent, const int id); + Skin(const Skin& skin, const Game* parent, const int id); /** * XML data constructor. * @@ -72,7 +72,7 @@ class SIGMOD_EXPORT Skin : public Object * \param parent The parent of the skin. * \param id The id number for the skin. */ - Skin(const QDomElement& xml, const Sigmod* parent, const int id = -1); + Skin(const QDomElement& xml, const Game* parent, const int id = -1); /** * Check to make sure the skin's values are valid. diff --git a/sigmod/Sound.cpp b/sigmod/Sound.cpp index c0f62820..58f33b31 100644 --- a/sigmod/Sound.cpp +++ b/sigmod/Sound.cpp @@ -23,8 +23,8 @@ #include "Sound.h" // Sigmod includes +#include "Game.h" #include "Macros.h" -#include "Sigmod.h" using namespace Sigmod; @@ -36,7 +36,7 @@ Sound::Sound(const Sound& sound) : *this = sound; } -Sound::Sound(const Sigmod* parent, const int id) : +Sound::Sound(const Game* parent, const int id) : Object(parent, id), m_name(""), m_type(SoundEffect), @@ -44,13 +44,13 @@ Sound::Sound(const Sigmod* parent, const int id) : { } -Sound::Sound(const Sound& sound, const Sigmod* parent, const int id) : +Sound::Sound(const Sound& sound, const Game* parent, const int id) : Object(parent, id) { *this = sound; } -Sound::Sound(const QDomElement& xml, const Sigmod* parent, const int id) : +Sound::Sound(const QDomElement& xml, const Game* parent, const int id) : Object(parent, id) { LOAD_ID(); diff --git a/sigmod/Sound.h b/sigmod/Sound.h index 124d587c..12623508 100644 --- a/sigmod/Sound.h +++ b/sigmod/Sound.h @@ -32,7 +32,7 @@ namespace Sigmod { // Forward declarations -class Sigmod; +class Game; /** * \class Sigmod::Sound Sound.h sigmod/Sound.h @@ -75,7 +75,7 @@ class SIGMOD_EXPORT Sound : public Object * \param parent The parent of the sound. * \param id The id number for the sound. */ - Sound(const Sigmod* parent, const int id); + Sound(const Game* parent, const int id); /** * Data copy constructor. Copies the data from \p sound as a child of \p parent with id \p id. * @@ -83,7 +83,7 @@ class SIGMOD_EXPORT Sound : public Object * \param parent The parent of the sound. * \param id The id number for the sound. */ - Sound(const Sound& sound, const Sigmod* parent, const int id); + Sound(const Sound& sound, const Game* parent, const int id); /** * XML data constructor. * @@ -91,7 +91,7 @@ class SIGMOD_EXPORT Sound : public Object * \param parent The parent of the sound. * \param id The id number for the sound. */ - Sound(const QDomElement& xml, const Sigmod* parent, const int id = -1); + Sound(const QDomElement& xml, const Game* parent, const int id = -1); /** * Check to make sure the sound's values are valid. diff --git a/sigmod/Species.cpp b/sigmod/Species.cpp index 42884220..c07efdf9 100644 --- a/sigmod/Species.cpp +++ b/sigmod/Species.cpp @@ -19,9 +19,9 @@ #include "Species.h" // Sigmod includes +#include "Game.h" #include "Macros.h" #include "Rules.h" -#include "Sigmod.h" #include "SpeciesMove.h" // Qt includes @@ -40,7 +40,7 @@ Species::Species(const Species& species) : *this = species; } -Species::Species(const Sigmod* parent, const int id) : +Species::Species(const Game* parent, const int id) : Object(parent, id), m_name(""), m_baseStat(ST_SpecialDefense - ST_HP + 1), @@ -72,7 +72,7 @@ Species::Species(const Sigmod* parent, const int id) : m_effortValue[i] = 0; } -Species::Species(const Species& species, const Sigmod* parent, const int id) : +Species::Species(const Species& species, const Game* parent, const int id) : Object(parent, id), m_baseStat(ST_SpecialDefense - ST_HP + 1), m_effortValue(ST_SpecialDefense - ST_HP + 1) @@ -80,7 +80,7 @@ Species::Species(const Species& species, const Sigmod* parent, const int id) : *this = species; } -Species::Species(const QDomElement& xml, const Sigmod* parent, const int id) : +Species::Species(const QDomElement& xml, const Game* parent, const int id) : Object(parent, id), m_baseStat(ST_SpecialDefense - ST_HP + 1), m_effortValue(ST_SpecialDefense - ST_HP + 1) @@ -103,7 +103,7 @@ void Species::validate() TEST_ARRAY_INDEX(baseStat, ST_Attack); TEST_ARRAY_INDEX(baseStat, ST_Defense); TEST_ARRAY_INDEX(baseStat, ST_Speed); - if (sigmod()->rules()->specialSplit()) + if (game()->rules()->specialSplit()) { TEST_ARRAY_INDEX(baseStat, ST_SpecialAttack); TEST_ARRAY_INDEX(baseStat, ST_SpecialDefense); @@ -114,7 +114,7 @@ void Species::validate() TEST_ARRAY_INDEX(effortValue, ST_Attack); TEST_ARRAY_INDEX(effortValue, ST_Defense); TEST_ARRAY_INDEX(effortValue, ST_Speed); - if (sigmod()->rules()->specialSplit()) + if (game()->rules()->specialSplit()) { TEST_ARRAY_INDEX(effortValue, ST_SpecialAttack); TEST_ARRAY_INDEX(effortValue, ST_SpecialDefense); @@ -134,7 +134,7 @@ void Species::validate() TEST(frontMaleSprite); TEST(backMaleSprite); } - if (sigmod()->rules()->genderAllowed() && (0 < m_genderFactor)) + if (game()->rules()->genderAllowed() && (0 < m_genderFactor)) { TEST(frontFemaleSprite); TEST(backFemaleSprite); @@ -143,9 +143,9 @@ void Species::validate() if ((m_encyclopediaNumber != -1) && m_encyclopediaEntry.isEmpty()) emit(error("Encyclopedia entry is empty")); TEST(genderFactor); - if (sigmod()->rules()->breedingAllowed() && m_eggGroup.size()) + if (game()->rules()->breedingAllowed() && m_eggGroup.size()) { - const Species* eggSpecies = sigmod()->speciesById(m_eggSpecies); + const Species* eggSpecies = game()->speciesById(m_eggSpecies); if (!eggSpecies) emit(error(bounds("egg species", m_eggSpecies))); else @@ -157,10 +157,10 @@ void Species::validate() } TEST_LIST(type); TEST_LIST(eggGroup); - if (m_ability.size() < sigmod()->rules()->maxAbilities()) + if (m_ability.size() < game()->rules()->maxAbilities()) emit(warning("There are too few abilities")); TEST_MAP(ability); - if (sigmod()->rules()->maxHeldItems() && !m_item.size()) + if (game()->rules()->maxHeldItems() && !m_item.size()) emit(warning("There are no items")); TEST_MAP(item); QSet<int> idChecker; @@ -302,7 +302,7 @@ CHECK_BEGIN_ARRAY(Species, int, baseStat, baseStat, Stat, stat) switch (stat) { case ST_SpecialDefense: - if (sigmod()->rules()->specialSplit()) + if (game()->rules()->specialSplit()) case ST_HP: case ST_Attack: case ST_Defense: @@ -310,7 +310,7 @@ CHECK_BEGIN_ARRAY(Species, int, baseStat, baseStat, Stat, stat) case ST_Special: break; default: - EBOUNDS(stat, "HP", sigmod()->rules()->specialSplit() ? "SpecialDefense" : "Special"); + EBOUNDS(stat, "HP", game()->rules()->specialSplit() ? "SpecialDefense" : "Special"); return false; } TBOUNDS(baseStat, 1, INT_MAX) @@ -319,7 +319,7 @@ CHECK_BEGIN_ARRAY(Species, int, effortValue, effortValue, Stat, stat) switch (stat) { case ST_SpecialDefense: - if (sigmod()->rules()->specialSplit()) + if (game()->rules()->specialSplit()) case ST_HP: case ST_Attack: case ST_Defense: @@ -327,10 +327,10 @@ CHECK_BEGIN_ARRAY(Species, int, effortValue, effortValue, Stat, stat) case ST_Special: break; default: - EBOUNDS(stat, "HP", sigmod()->rules()->specialSplit() ? "SpecialDefense" : "Special"); + EBOUNDS(stat, "HP", game()->rules()->specialSplit() ? "SpecialDefense" : "Special"); return false; } - TBOUNDS(effortValue, 0, sigmod()->rules()->maxEVPerStat() ? sigmod()->rules()->maxEVPerStat() : INT_MAX) + TBOUNDS(effortValue, 0, game()->rules()->maxEVPerStat() ? game()->rules()->maxEVPerStat() : INT_MAX) CHECK_END() CHECK(Species, Style, growth) CHECK_BOUNDS(Species, int, experienceValue, 0, INT_MAX) @@ -348,7 +348,7 @@ CHECK_BEGIN(Species, int, frontMaleSprite) ERROR("Species cannot be male"); return false; } - IBOUNDS(frontMaleSprite, sigmod(), sprite); + IBOUNDS(frontMaleSprite, game(), sprite); CHECK_END() CHECK_BEGIN(Species, int, backMaleSprite) if (1 <= m_genderFactor) @@ -356,38 +356,38 @@ CHECK_BEGIN(Species, int, backMaleSprite) ERROR("Species cannot be male"); return false; } - IBOUNDS(backMaleSprite, sigmod(), sprite); + IBOUNDS(backMaleSprite, game(), sprite); CHECK_END() CHECK_BEGIN(Species, int, frontFemaleSprite) - if (!sigmod()->rules()->genderAllowed() || (m_genderFactor <= 0)) + if (!game()->rules()->genderAllowed() || (m_genderFactor <= 0)) { ERROR("Species cannot be female"); return false; } - IBOUNDS(frontFemaleSprite, sigmod(), sprite); + IBOUNDS(frontFemaleSprite, game(), sprite); CHECK_END() CHECK_BEGIN(Species, int, backFemaleSprite) - if (!sigmod()->rules()->genderAllowed() || (m_genderFactor <= 0)) + if (!game()->rules()->genderAllowed() || (m_genderFactor <= 0)) { ERROR("Species cannot be female"); return false; } - IBOUNDS(backFemaleSprite, sigmod(), sprite); + IBOUNDS(backFemaleSprite, game(), sprite); CHECK_END() -CHECK_INDEX(Species, int, skin, sigmod(), skin) +CHECK_INDEX(Species, int, skin, game(), skin) CHECK(Species, QString&, encyclopediaEntry) CHECK_BOUNDS(Species, Fraction&, genderFactor, -1, 1) -CHECK_INDEX(Species, int, eggSpecies, sigmod(), species) +CHECK_INDEX(Species, int, eggSpecies, game(), species) CHECK_BOUNDS(Species, int, eggSteps, 1, INT_MAX) -CHECK_INDEX(Species, int, type, sigmod(), type) -CHECK_INDEX(Species, int, eggGroup, sigmod(), eggGroup) +CHECK_INDEX(Species, int, type, game(), type) +CHECK_INDEX(Species, int, eggGroup, game(), eggGroup) CHECK(Species, Script&, evolution) CHECK_BEGIN_ARRAY(Species, int, ability, weight, int, ability) - IBOUNDS(ability, sigmod(), ability); + IBOUNDS(ability, game(), ability); TBOUNDS_MOD(ability_weight, 1, INT_MAX, weight) CHECK_END() CHECK_BEGIN_ARRAY(Species, int, item, weight, int, item) - IBOUNDS(item, sigmod(), item); + IBOUNDS(item, game(), item); TBOUNDS_MOD(species_item, 1, INT_MAX, weight) CHECK_END() diff --git a/sigmod/Species.h b/sigmod/Species.h index 083f9c90..db6ed88b 100644 --- a/sigmod/Species.h +++ b/sigmod/Species.h @@ -33,7 +33,7 @@ namespace Sigmod { // Forward declarations -class Sigmod; +class Game; class SpeciesMove; class SIGMOD_EXPORT Species : public Object @@ -54,9 +54,9 @@ class SIGMOD_EXPORT Species : public Object static const QStringList StyleStr; Species(const Species& species); - Species(const Sigmod* parent, const int id); - Species(const Species& species, const Sigmod* parent, const int id); - Species(const QDomElement& xml, const Sigmod* parent, const int id = -1); + Species(const Game* parent, const int id); + Species(const Species& species, const Game* parent, const int id); + Species(const QDomElement& xml, const Game* parent, const int id = -1); ~Species(); void validate(); diff --git a/sigmod/SpeciesMove.cpp b/sigmod/SpeciesMove.cpp index 0598e000..6f2f0da6 100644 --- a/sigmod/SpeciesMove.cpp +++ b/sigmod/SpeciesMove.cpp @@ -23,9 +23,9 @@ #include "SpeciesMove.h" // Sigmod includes +#include "Game.h" #include "Macros.h" #include "Rules.h" -#include "Sigmod.h" #include "Species.h" using namespace Sigmod; @@ -91,9 +91,9 @@ GETTER(SpeciesMove, int, move) GETTER(SpeciesMove, int, level) GETTER(SpeciesMove, int, wild) -CHECK_INDEX(SpeciesMove, int, move, sigmod(), move) -CHECK_BOUNDS(SpeciesMove, int, level, -1, sigmod()->rules()->maxLevel()) -CHECK_BOUNDS(SpeciesMove, int, wild, -1, sigmod()->rules()->maxLevel()) +CHECK_INDEX(SpeciesMove, int, move, game(), move) +CHECK_BOUNDS(SpeciesMove, int, level, -1, game()->rules()->maxLevel()) +CHECK_BOUNDS(SpeciesMove, int, wild, -1, game()->rules()->maxLevel()) SpeciesMove& SpeciesMove::operator=(const SpeciesMove& rhs) { diff --git a/sigmod/Sprite.cpp b/sigmod/Sprite.cpp index c555029d..4edd218d 100644 --- a/sigmod/Sprite.cpp +++ b/sigmod/Sprite.cpp @@ -23,8 +23,8 @@ #include "Sprite.h" // Sigmod includes +#include "Game.h" #include "Macros.h" -#include "Sigmod.h" using namespace Sigmod; @@ -34,20 +34,20 @@ Sprite::Sprite(const Sprite& sprite) : *this = sprite; } -Sprite::Sprite(const Sigmod* parent, const int id) : +Sprite::Sprite(const Game* parent, const int id) : Object(parent, id), m_name(""), m_sprite() { } -Sprite::Sprite(const Sprite& sprite, const Sigmod* parent, const int id) : +Sprite::Sprite(const Sprite& sprite, const Game* parent, const int id) : Object(parent, id) { *this = sprite; } -Sprite::Sprite(const QDomElement& xml, const Sigmod* parent, const int id) : +Sprite::Sprite(const QDomElement& xml, const Game* parent, const int id) : Object(parent, id) { LOAD_ID(); diff --git a/sigmod/Sprite.h b/sigmod/Sprite.h index 2ee25493..98d148b7 100644 --- a/sigmod/Sprite.h +++ b/sigmod/Sprite.h @@ -31,7 +31,7 @@ namespace Sigmod { // Forward declarations -class Sigmod; +class Game; /** * \class Sigmod::Sprite Sprite.h sigmod/Sprite.h @@ -56,7 +56,7 @@ class SIGMOD_EXPORT Sprite : public Object * \param parent The parent of the sprite. * \param id The id number for the sprite. */ - Sprite(const Sigmod* parent, const int id); + Sprite(const Game* parent, const int id); /** * Data copy constructor. Copies the data from \p sprite as a child of \p parent with id \p id. * @@ -64,7 +64,7 @@ class SIGMOD_EXPORT Sprite : public Object * \param parent The parent of the sprite. * \param id The id number for the sprite. */ - Sprite(const Sprite& sprite, const Sigmod* parent, const int id); + Sprite(const Sprite& sprite, const Game* parent, const int id); /** * XML data constructor. * @@ -72,7 +72,7 @@ class SIGMOD_EXPORT Sprite : public Object * \param parent The parent of the sprite. * \param id The id number for the sprite. */ - Sprite(const QDomElement& xml, const Sigmod* parent, const int id = -1); + Sprite(const QDomElement& xml, const Game* parent, const int id = -1); /** * Check to make sure the sprite's values are valid. diff --git a/sigmod/Status.cpp b/sigmod/Status.cpp index 81928ba7..d7221acb 100644 --- a/sigmod/Status.cpp +++ b/sigmod/Status.cpp @@ -23,8 +23,8 @@ #include "Status.h" // Sigmod includes +#include "Game.h" #include "Macros.h" -#include "Sigmod.h" using namespace Sigcore; using namespace Sigmod; @@ -35,7 +35,7 @@ Status::Status(const Status& status) : *this = status; } -Status::Status(const Sigmod* parent, const int id) : +Status::Status(const Game* parent, const int id) : Object(parent, id), m_name(""), m_battleScript("", ""), @@ -43,13 +43,13 @@ Status::Status(const Sigmod* parent, const int id) : { } -Status::Status(const Status& status, const Sigmod* parent, const int id) : +Status::Status(const Status& status, const Game* parent, const int id) : Object(parent, id) { *this = status; } -Status::Status(const QDomElement& xml, const Sigmod* parent, const int id) : +Status::Status(const QDomElement& xml, const Game* parent, const int id) : Object(parent, id) { LOAD_ID(); diff --git a/sigmod/Status.h b/sigmod/Status.h index 079e1b88..92f70b8b 100644 --- a/sigmod/Status.h +++ b/sigmod/Status.h @@ -31,7 +31,7 @@ namespace Sigmod { // Forward declarations -class Sigmod; +class Game; /** * \class Sigmod::Status Status.h sigmod/Status.h @@ -59,7 +59,7 @@ class SIGMOD_EXPORT Status : public Object * \param parent The parent of the status. * \param id The id number for the status. */ - Status(const Sigmod* parent, const int id); + Status(const Game* parent, const int id); /** * Data copy constructor. Copies the data from \p status as a child of \p parent with id \p id. * @@ -67,7 +67,7 @@ class SIGMOD_EXPORT Status : public Object * \param parent The parent of the status. * \param id The id number for the status. */ - Status(const Status& status, const Sigmod* parent, const int id); + Status(const Status& status, const Game* parent, const int id); /** * XML data constructor. * @@ -75,7 +75,7 @@ class SIGMOD_EXPORT Status : public Object * \param parent The parent of the status. * \param id The id number for the status. */ - Status(const QDomElement& xml, const Sigmod* parent, const int id = -1); + Status(const QDomElement& xml, const Game* parent, const int id = -1); /** * Check to make sure the status' values are valid. diff --git a/sigmod/Store.cpp b/sigmod/Store.cpp index aa65228e..810e1840 100644 --- a/sigmod/Store.cpp +++ b/sigmod/Store.cpp @@ -23,8 +23,8 @@ #include "Store.h" // Sigmod includes +#include "Game.h" #include "Macros.h" -#include "Sigmod.h" using namespace Sigmod; @@ -34,19 +34,19 @@ Store::Store(const Store& store) : *this = store; } -Store::Store(const Sigmod* parent, const int id) : +Store::Store(const Game* parent, const int id) : Object(parent, id), m_name("") { } -Store::Store(const Store& store, const Sigmod* parent, const int id) : +Store::Store(const Store& store, const Game* parent, const int id) : Object(parent, id) { *this = store; } -Store::Store(const QDomElement& xml, const Sigmod* parent, const int id) : +Store::Store(const QDomElement& xml, const Game* parent, const int id) : Object(parent, id) { LOAD_ID(); @@ -87,7 +87,7 @@ GETTER(Store, QString, name) GETTER_LIST(Store, item) CHECK(Store, QString&, name) -CHECK_INDEX(Store, int, item, sigmod(), item) +CHECK_INDEX(Store, int, item, game(), item) Store& Store::operator=(const Store& rhs) { diff --git a/sigmod/Store.h b/sigmod/Store.h index 1097119c..eae94a01 100644 --- a/sigmod/Store.h +++ b/sigmod/Store.h @@ -31,7 +31,7 @@ namespace Sigmod { // Forward declarations -class Sigmod; +class Game; /** * \class Sigmod::Store Store.h sigmod/Store.h @@ -56,7 +56,7 @@ class SIGMOD_EXPORT Store : public Object * \param parent The parent of the store. * \param id The id number for the store. */ - Store(const Sigmod* parent, const int id); + Store(const Game* parent, const int id); /** * Data copy constructor. Copies the data from \p store as a child of \p parent with id \p id. * @@ -64,7 +64,7 @@ class SIGMOD_EXPORT Store : public Object * \param parent The parent of the store. * \param id The id number for the store. */ - Store(const Store& store, const Sigmod* parent, const int id); + Store(const Store& store, const Game* parent, const int id); /** * XML data constructor. * @@ -72,7 +72,7 @@ class SIGMOD_EXPORT Store : public Object * \param parent The parent of the store. * \param id The id number for the store. */ - Store(const QDomElement& xml, const Sigmod* parent, const int id = -1); + Store(const QDomElement& xml, const Game* parent, const int id = -1); /** * Check to make sure the store's values are valid. diff --git a/sigmod/Tile.cpp b/sigmod/Tile.cpp index 18cc0ba5..b478dbdf 100644 --- a/sigmod/Tile.cpp +++ b/sigmod/Tile.cpp @@ -23,8 +23,8 @@ #include "Tile.h" // Sigmod includes +#include "Game.h" #include "Macros.h" -#include "Sigmod.h" using namespace Sigcore; using namespace Sigmod; @@ -35,7 +35,7 @@ Tile::Tile(const Tile& tile) : *this = tile; } -Tile::Tile(const Sigmod* parent, const int id) : +Tile::Tile(const Game* parent, const int id) : Object(parent, id), m_name(""), m_walkable(true), @@ -43,13 +43,13 @@ Tile::Tile(const Sigmod* parent, const int id) : { } -Tile::Tile(const Tile& tile, const Sigmod* parent, const int id) : +Tile::Tile(const Tile& tile, const Game* parent, const int id) : Object(parent, id) { *this = tile; } -Tile::Tile(const QDomElement& xml, const Sigmod* parent, const int id) : +Tile::Tile(const QDomElement& xml, const Game* parent, const int id) : Object(parent, id) { LOAD_ID(); diff --git a/sigmod/Tile.h b/sigmod/Tile.h index e632cf73..f6a00917 100644 --- a/sigmod/Tile.h +++ b/sigmod/Tile.h @@ -27,7 +27,7 @@ namespace Sigmod { // Forward declarations -class Sigmod; +class Game; /** * \class Sigmod::Tile Tile.h sigmod/Tile.h @@ -55,7 +55,7 @@ class SIGMOD_EXPORT Tile : public Object * \param parent The parent of the tile. * \param id The id number for the tile. */ - Tile(const Sigmod* parent, const int id); + Tile(const Game* parent, const int id); /** * Data copy constructor. Copies the data from \p tile as a child of \p parent with id \p id. * @@ -63,7 +63,7 @@ class SIGMOD_EXPORT Tile : public Object * \param parent The parent of the tile. * \param id The id number for the tile. */ - Tile(const Tile& tile, const Sigmod* parent, const int id); + Tile(const Tile& tile, const Game* parent, const int id); /** * XML data constructor. * @@ -71,7 +71,7 @@ class SIGMOD_EXPORT Tile : public Object * \param parent The parent of the tile. * \param id The id number for the tile. */ - Tile(const QDomElement& xml, const Sigmod* parent, const int id = -1); + Tile(const QDomElement& xml, const Game* parent, const int id = -1); /** * Check to make sure the tile's values are valid. diff --git a/sigmod/Time.cpp b/sigmod/Time.cpp index c5b5c225..342ff129 100644 --- a/sigmod/Time.cpp +++ b/sigmod/Time.cpp @@ -23,8 +23,8 @@ #include "Time.h" // Sigmod includes +#include "Game.h" #include "Macros.h" -#include "Sigmod.h" using namespace Sigcore; using namespace Sigmod; @@ -35,7 +35,7 @@ Time::Time(const Time& time) : *this = time; } -Time::Time(const Sigmod* parent, const int id) : +Time::Time(const Game* parent, const int id) : Object(parent, id), m_name(""), m_hour(0), @@ -44,13 +44,13 @@ Time::Time(const Sigmod* parent, const int id) : { } -Time::Time(const Time& time, const Sigmod* parent, const int id) : +Time::Time(const Time& time, const Game* parent, const int id) : Object(parent, id) { *this = time; } -Time::Time(const QDomElement& xml, const Sigmod* parent, const int id) : +Time::Time(const QDomElement& xml, const Game* parent, const int id) : Object(parent, id) { LOAD_ID(); diff --git a/sigmod/Time.h b/sigmod/Time.h index 5d761bae..a89af615 100644 --- a/sigmod/Time.h +++ b/sigmod/Time.h @@ -31,7 +31,7 @@ namespace Sigmod { // Forward declarations -class Sigmod; +class Game; /** * \class Sigmod::Time Time.h sigmod/Time.h @@ -58,7 +58,7 @@ class SIGMOD_EXPORT Time : public Object * \param parent The parent of the time. * \param id The id number for the time. */ - Time(const Sigmod* parent, const int id); + Time(const Game* parent, const int id); /** * Data copy constructor. Copies the data from \p time as a child of \p parent with id \p id. * @@ -66,7 +66,7 @@ class SIGMOD_EXPORT Time : public Object * \param parent The parent of the time. * \param id The id number for the time. */ - Time(const Time& time, const Sigmod* parent, const int id); + Time(const Time& time, const Game* parent, const int id); /** * XML data constructor. * @@ -74,7 +74,7 @@ class SIGMOD_EXPORT Time : public Object * \param parent The parent of the time. * \param id The id number for the time. */ - Time(const QDomElement& xml, const Sigmod* parent, const int id = -1); + Time(const QDomElement& xml, const Game* parent, const int id = -1); /** * Check to make sure the time's values are valid. diff --git a/sigmod/Trainer.cpp b/sigmod/Trainer.cpp index 4a12f017..2497cab5 100644 --- a/sigmod/Trainer.cpp +++ b/sigmod/Trainer.cpp @@ -23,8 +23,8 @@ #include "Trainer.h" // Sigmod includes +#include "Game.h" #include "Macros.h" -#include "Sigmod.h" using namespace Sigcore; using namespace Sigmod; @@ -37,7 +37,7 @@ Trainer::Trainer(const Trainer& trainer) : *this = trainer; } -Trainer::Trainer(const Sigmod* parent, const int id) : +Trainer::Trainer(const Game* parent, const int id) : Object(parent, id), m_name(""), m_moneyFactor(0), @@ -51,13 +51,13 @@ Trainer::Trainer(const Sigmod* parent, const int id) : { } -Trainer::Trainer(const Trainer& trainer, const Sigmod* parent, const int id) : +Trainer::Trainer(const Trainer& trainer, const Game* parent, const int id) : Object(parent, id) { *this = trainer; } -Trainer::Trainer(const QDomElement& xml, const Sigmod* parent, const int id) : +Trainer::Trainer(const QDomElement& xml, const Game* parent, const int id) : Object(parent, id) { LOAD_ID(); @@ -126,7 +126,7 @@ GETTER(Trainer, Trainer::Intelligence, statIntel) CHECK(Trainer, QString&, name) CHECK_BOUNDS(Trainer, int, moneyFactor, 0, INT_MAX) -CHECK_INDEX(Trainer, int, skin, sigmod(), skin) +CHECK_INDEX(Trainer, int, skin, game(), skin) CHECK_BOUNDS(Trainer, int, depth, 0, INT_MAX) CHECK(Trainer, Intelligence, teamIntel) CHECK(Trainer, Intelligence, moveIntel) diff --git a/sigmod/Trainer.h b/sigmod/Trainer.h index 30a2a35c..b3ebf2d9 100644 --- a/sigmod/Trainer.h +++ b/sigmod/Trainer.h @@ -31,7 +31,7 @@ namespace Sigmod { // Forward declarations -class Sigmod; +class Game; /** * \class Sigmod::Trainer Trainer.h sigmod/Trainer.h @@ -78,7 +78,7 @@ class SIGMOD_EXPORT Trainer : public Object * \param parent The parent of the trainer. * \param id The id number for the trainer. */ - Trainer(const Sigmod* parent, const int id); + Trainer(const Game* parent, const int id); /** * Data copy constructor. Copies the data from \p trainer as a child of \p parent with id \p id. * @@ -86,7 +86,7 @@ class SIGMOD_EXPORT Trainer : public Object * \param parent The parent of the trainer. * \param id The id number for the trainer. */ - Trainer(const Trainer& trainer, const Sigmod* parent, const int id); + Trainer(const Trainer& trainer, const Game* parent, const int id); /** * XML data constructor. * @@ -94,7 +94,7 @@ class SIGMOD_EXPORT Trainer : public Object * \param parent The parent of the trainer. * \param id The id number for the trainer. */ - Trainer(const QDomElement& xml, const Sigmod* parent, const int id = -1); + Trainer(const QDomElement& xml, const Game* parent, const int id = -1); /** * Check to make sure the trainer's values are valid. diff --git a/sigmod/Type.cpp b/sigmod/Type.cpp index 935aeb4e..bbd3d2e1 100644 --- a/sigmod/Type.cpp +++ b/sigmod/Type.cpp @@ -23,8 +23,8 @@ #include "Type.h" // Sigmod includes +#include "Game.h" #include "Macros.h" -#include "Sigmod.h" using namespace Sigcore; using namespace Sigmod; @@ -35,20 +35,20 @@ Type::Type(const Type& type) : *this = type; } -Type::Type(const Sigmod* parent, const int id) : +Type::Type(const Game* parent, const int id) : Object(parent, id), m_name(""), m_stab(1, 1) { } -Type::Type(const Type& type, const Sigmod* parent, const int id) : +Type::Type(const Type& type, const Game* parent, const int id) : Object(parent, id) { *this = type; } -Type::Type(const QDomElement& xml, const Sigmod* parent, const int id) : +Type::Type(const QDomElement& xml, const Game* parent, const int id) : Object(parent, id) { LOAD_ID(); diff --git a/sigmod/Type.h b/sigmod/Type.h index 412e8fcc..ce85833a 100644 --- a/sigmod/Type.h +++ b/sigmod/Type.h @@ -31,7 +31,7 @@ namespace Sigmod { // Forward declarations -class Sigmod; +class Game; /** * \class Sigmod::Type Type.h sigmod/Type.h @@ -57,7 +57,7 @@ class SIGMOD_EXPORT Type : public Object * \param parent The parent of the type. * \param id The id number for the type. */ - Type(const Sigmod* parent, const int id); + Type(const Game* parent, const int id); /** * Data copy constructor. Copies the data from \p type as a child of \p parent with id \p id. * @@ -65,7 +65,7 @@ class SIGMOD_EXPORT Type : public Object * \param parent The parent of the type. * \param id The id number for the type. */ - Type(const Type& type, const Sigmod* parent, const int id); + Type(const Type& type, const Game* parent, const int id); /** * XML data constructor. * @@ -73,7 +73,7 @@ class SIGMOD_EXPORT Type : public Object * \param parent The parent of the type. * \param id The id number for the type. */ - Type(const QDomElement& xml, const Sigmod* parent, const int id = -1); + Type(const QDomElement& xml, const Game* parent, const int id = -1); /** * Check to make sure the type's values are valid. diff --git a/sigmod/Weather.cpp b/sigmod/Weather.cpp index 8cee3acd..dfa42d4c 100644 --- a/sigmod/Weather.cpp +++ b/sigmod/Weather.cpp @@ -23,8 +23,8 @@ #include "Weather.h" // Sigmod includes +#include "Game.h" #include "Macros.h" -#include "Sigmod.h" using namespace Sigcore; using namespace Sigmod; @@ -35,20 +35,20 @@ Weather::Weather(const Weather& weather) : *this = weather; } -Weather::Weather(const Sigmod* parent, const int id) : +Weather::Weather(const Game* parent, const int id) : Object(parent, id), m_name(""), m_script("", "") { } -Weather::Weather(const Weather& weather, const Sigmod* parent, const int id) : +Weather::Weather(const Weather& weather, const Game* parent, const int id) : Object(parent, id) { *this = weather; } -Weather::Weather(const QDomElement& xml, const Sigmod* parent, const int id) : +Weather::Weather(const QDomElement& xml, const Game* parent, const int id) : Object(parent, id) { LOAD_ID(); diff --git a/sigmod/Weather.h b/sigmod/Weather.h index d7952ba5..8f884de1 100644 --- a/sigmod/Weather.h +++ b/sigmod/Weather.h @@ -31,7 +31,7 @@ namespace Sigmod { // Forward declarations -class Sigmod; +class Game; /** * \class Sigmod::Weather Weather.h sigmod/Weather.h @@ -56,7 +56,7 @@ class SIGMOD_EXPORT Weather : public Object * \param parent The parent of the weather. * \param id The id number for the weather. */ - Weather(const Sigmod* parent, const int id); + Weather(const Game* parent, const int id); /** * Data copy constructor. Copies the data from \p weather as a child of \p parent with id \p id. * @@ -64,7 +64,7 @@ class SIGMOD_EXPORT Weather : public Object * \param parent The parent of the weather. * \param id The id number for the weather. */ - Weather(const Weather& weather, const Sigmod* parent, const int id); + Weather(const Weather& weather, const Game* parent, const int id); /** * XML data constructor. * @@ -72,7 +72,7 @@ class SIGMOD_EXPORT Weather : public Object * \param parent The parent of the weather. * \param id The id number for the weather. */ - Weather(const QDomElement& xml, const Sigmod* parent, const int id = -1); + Weather(const QDomElement& xml, const Game* parent, const int id = -1); /** * Check to make sure the weather's values are valid. |