diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2008-04-17 23:34:36 +0000 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2008-04-17 23:34:36 +0000 |
| commit | 6679f5cffa9d35a23b76605ddfbf3257f882b6ee (patch) | |
| tree | c8e41854a60b64e8569939bca6b827807175ef9a /pokemod/Pokemod.cpp | |
| parent | 05980e883719b1c8ebde1bd2fcbf4f8c16df7ad6 (diff) | |
| download | sigen-6679f5cffa9d35a23b76605ddfbf3257f882b6ee.tar.gz sigen-6679f5cffa9d35a23b76605ddfbf3257f882b6ee.tar.xz sigen-6679f5cffa9d35a23b76605ddfbf3257f882b6ee.zip | |
[FIX] Frac -> Fraction
[FIX] ImageCache and Ini removed
[FIX] Fraction/Point widgets moved to pokemodr
[FIX] Copy ctors made for pokemod classes
[FIX] Ctors in pokemod fixed
[FIX] Copyright headers fixed in pokemodr
[FIX] PokeModr updated to new API and fixed in some places
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@99 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemod/Pokemod.cpp')
| -rw-r--r-- | pokemod/Pokemod.cpp | 94 |
1 files changed, 47 insertions, 47 deletions
diff --git a/pokemod/Pokemod.cpp b/pokemod/Pokemod.cpp index 6070b9fa..b5cc1cc5 100644 --- a/pokemod/Pokemod.cpp +++ b/pokemod/Pokemod.cpp @@ -63,7 +63,7 @@ Pokemod::Pokemod() : m_startWarp(INT_MAX), m_superPCUname(""), m_superPCPasswd(""), - m_typeChart(0, 0),//, Frac(1, 1, Frac::Improper)), + m_typeChart(0, 0),//, Fraction(1, 1, Fraction::Improper)), m_rules(this) { } @@ -404,7 +404,7 @@ void Pokemod::load(const QDomElement& xml, const int) throw(Exception) LOAD_SUB(newTime, times); LOAD_SUB(newTrainer, trainers); LOAD_SUB(newType, types); - LOAD_MATRIX(setTypeChart, Frac, typeChart); + LOAD_MATRIX(setTypeChart, Fraction, typeChart); } QDomElement Pokemod::save() const @@ -425,7 +425,7 @@ QDomElement Pokemod::save() const SAVE(QString, superPCUname); SAVE(QString, superPCPasswd); xml.appendChild(m_rules.save()); - SAVE_MATRIX(Frac, typeChart); + SAVE_MATRIX(Fraction, typeChart); SAVE_SUB(Ability, abilities); SAVE_SUB(Author, authors); SAVE_SUB(Badge, badges); @@ -547,7 +547,7 @@ void Pokemod::setSuperPCPasswd(const QString& password) m_superPCPasswd = password; } -void Pokemod::setTypeChart(const int attack, const int defense, const Frac& multiplier) throw(Exception) +void Pokemod::setTypeChart(const int attack, const int defense, const Fraction& multiplier) throw(Exception) { m_typeChart(attack, defense) = multiplier; } @@ -627,17 +627,17 @@ QString Pokemod::superPCPasswd() const return m_superPCPasswd; } -const Matrix<Frac>* Pokemod::typeChart() const +const Matrix<Fraction>* Pokemod::typeChart() const { return &m_typeChart; } -Matrix<Frac>* Pokemod::typeChart() +Matrix<Fraction>* Pokemod::typeChart() { return &m_typeChart; } -Frac Pokemod::typeChart(const int attack, const int defense) const +Fraction Pokemod::typeChart(const int attack, const int defense) const { return m_typeChart(attack, defense); } @@ -699,13 +699,13 @@ Ability* Pokemod::newAbility() Ability* Pokemod::newAbility(const QDomElement& xml) { - m_abilities.append(new Ability(this, xml, newAbilityId())); + m_abilities.append(new Ability(xml, this, newAbilityId())); return m_abilities[abilityCount() - 1]; } Ability* Pokemod::newAbility(const Ability& ability) { - m_abilities.append(new Ability(this, ability, newAbilityId())); + m_abilities.append(new Ability(ability, this, newAbilityId())); return m_abilities[abilityCount() - 1]; } @@ -777,13 +777,13 @@ Author* Pokemod::newAuthor() Author* Pokemod::newAuthor(const QDomElement& xml) { - m_authors.append(new Author(this, xml, newAuthorId())); + m_authors.append(new Author(xml, this, newAuthorId())); return m_authors[authorCount() - 1]; } Author* Pokemod::newAuthor(const Author& author) { - m_authors.append(new Author(this, author, newAuthorId())); + m_authors.append(new Author(author, this, newAuthorId())); return m_authors[authorCount() - 1]; } @@ -855,13 +855,13 @@ Badge* Pokemod::newBadge() Badge* Pokemod::newBadge(const QDomElement& xml) { - m_badges.append(new Badge(this, xml, newBadgeId())); + m_badges.append(new Badge(xml, this, newBadgeId())); return m_badges[badgeCount() - 1]; } Badge* Pokemod::newBadge(const Badge& badge) { - m_badges.append(new Badge(this, badge, newBadgeId())); + m_badges.append(new Badge(badge, this, newBadgeId())); return m_badges[badgeCount() - 1]; } @@ -933,13 +933,13 @@ CoinList* Pokemod::newCoinList() CoinList* Pokemod::newCoinList(const QDomElement& xml) { - m_coinLists.append(new CoinList(this, xml, newCoinListId())); + m_coinLists.append(new CoinList(xml, this, newCoinListId())); return m_coinLists[coinListCount() - 1]; } CoinList* Pokemod::newCoinList(const CoinList& coinList) { - m_coinLists.append(new CoinList(this, coinList, newCoinListId())); + m_coinLists.append(new CoinList(coinList, this, newCoinListId())); return m_coinLists[coinListCount() - 1]; } @@ -1011,13 +1011,13 @@ Dialog* Pokemod::newDialog() Dialog* Pokemod::newDialog(const QDomElement& xml) { - m_dialogs.append(new Dialog(this, xml, newDialogId())); + m_dialogs.append(new Dialog(xml, this, newDialogId())); return m_dialogs[dialogCount() - 1]; } Dialog* Pokemod::newDialog(const Dialog& dialog) { - m_dialogs.append(new Dialog(this, dialog, newDialogId())); + m_dialogs.append(new Dialog(dialog, this, newDialogId())); return m_dialogs[dialogCount() - 1]; } @@ -1089,13 +1089,13 @@ EggGroup* Pokemod::newEggGroup() EggGroup* Pokemod::newEggGroup(const QDomElement& xml) { - m_eggGroups.append(new EggGroup(this, xml, newEggGroupId())); + m_eggGroups.append(new EggGroup(xml, this, newEggGroupId())); return m_eggGroups[eggGroupCount() - 1]; } EggGroup* Pokemod::newEggGroup(const EggGroup& eggGroup) { - m_eggGroups.append(new EggGroup(this, eggGroup, newEggGroupId())); + m_eggGroups.append(new EggGroup(eggGroup, this, newEggGroupId())); return m_eggGroups[eggGroupCount() - 1]; } @@ -1167,13 +1167,13 @@ Item* Pokemod::newItem() Item* Pokemod::newItem(const QDomElement& xml) { - m_items.append(new Item(this, xml, newItemId())); + m_items.append(new Item(xml, this, newItemId())); return m_items[itemCount() - 1]; } Item* Pokemod::newItem(const Item& item) { - m_items.append(new Item(this, item, newItemId())); + m_items.append(new Item(item, this, newItemId())); return m_items[itemCount() - 1]; } @@ -1245,13 +1245,13 @@ ItemType* Pokemod::newItemType() ItemType* Pokemod::newItemType(const QDomElement& xml) { - m_itemTypes.append(new ItemType(this, xml, newItemTypeId())); + m_itemTypes.append(new ItemType(xml, this, newItemTypeId())); return m_itemTypes[itemTypeCount() - 1]; } ItemType* Pokemod::newItemType(const ItemType& itemType) { - m_itemTypes.append(new ItemType(this, itemType, newItemTypeId())); + m_itemTypes.append(new ItemType(itemType, this, newItemTypeId())); return m_itemTypes[itemTypeCount() - 1]; } @@ -1323,13 +1323,13 @@ Map* Pokemod::newMap() Map* Pokemod::newMap(const QDomElement& xml) { - m_maps.append(new Map(this, xml, newMapId())); + m_maps.append(new Map(xml, this, newMapId())); return m_maps[mapCount() - 1]; } Map* Pokemod::newMap(const Map& map) { - m_maps.append(new Map(this, map, newMapId())); + m_maps.append(new Map(map, this, newMapId())); return m_maps[mapCount() - 1]; } @@ -1401,13 +1401,13 @@ Move* Pokemod::newMove() Move* Pokemod::newMove(const QDomElement& xml) { - m_moves.append(new Move(this, xml, newMoveId())); + m_moves.append(new Move(xml, this, newMoveId())); return m_moves[moveCount() - 1]; } Move* Pokemod::newMove(const Move& move) { - m_moves.append(new Move(this, move, newMoveId())); + m_moves.append(new Move(move, this, newMoveId())); return m_moves[moveCount() - 1]; } @@ -1479,13 +1479,13 @@ Nature* Pokemod::newNature() Nature* Pokemod::newNature(const QDomElement& xml) { - m_natures.append(new Nature(this, xml, newNatureId())); + m_natures.append(new Nature(xml, this, newNatureId())); return m_natures[natureCount() - 1]; } Nature* Pokemod::newNature(const Nature& nature) { - m_natures.append(new Nature(this, nature, newNatureId())); + m_natures.append(new Nature(nature, this, newNatureId())); return m_natures[natureCount() - 1]; } @@ -1557,13 +1557,13 @@ Species* Pokemod::newSpecies() Species* Pokemod::newSpecies(const QDomElement& xml) { - m_species.append(new Species(this, xml, newSpeciesId())); + m_species.append(new Species(xml, this, newSpeciesId())); return m_species[speciesCount() - 1]; } Species* Pokemod::newSpecies(const Species& species) { - m_species.append(new Species(this, species, newSpeciesId())); + m_species.append(new Species(species, this, newSpeciesId())); return m_species[speciesCount() - 1]; } @@ -1635,13 +1635,13 @@ Store* Pokemod::newStore() Store* Pokemod::newStore(const QDomElement& xml) { - m_stores.append(new Store(this, xml, newStoreId())); + m_stores.append(new Store(xml, this, newStoreId())); return m_stores[storeCount() - 1]; } Store* Pokemod::newStore(const Store& store) { - m_stores.append(new Store(this, store, newStoreId())); + m_stores.append(new Store(store, this, newStoreId())); return m_stores[storeCount() - 1]; } @@ -1713,13 +1713,13 @@ Tile* Pokemod::newTile() Tile* Pokemod::newTile(const QDomElement& xml) { - m_tiles.append(new Tile(this, xml, newTileId())); + m_tiles.append(new Tile(xml, this, newTileId())); return m_tiles[tileCount() - 1]; } Tile* Pokemod::newTile(const Tile& tile) { - m_tiles.append(new Tile(this, tile, newTileId())); + m_tiles.append(new Tile(tile, this, newTileId())); return m_tiles[tileCount() - 1]; } @@ -1791,13 +1791,13 @@ Time* Pokemod::newTime() Time* Pokemod::newTime(const QDomElement& xml) { - m_times.append(new Time(this, xml, newTimeId())); + m_times.append(new Time(xml, this, newTimeId())); return m_times[timeCount() - 1]; } Time* Pokemod::newTime(const Time& time) { - m_times.append(new Time(this, time, newTimeId())); + m_times.append(new Time(time, this, newTimeId())); return m_times[timeCount() - 1]; } @@ -1869,13 +1869,13 @@ Trainer* Pokemod::newTrainer() Trainer* Pokemod::newTrainer(const QDomElement& xml) { - m_trainers.append(new Trainer(this, xml, newTrainerId())); + m_trainers.append(new Trainer(xml, this, newTrainerId())); return m_trainers[trainerCount() - 1]; } Trainer* Pokemod::newTrainer(const Trainer& trainer) { - m_trainers.append(new Trainer(this, trainer, newTrainerId())); + m_trainers.append(new Trainer(trainer, this, newTrainerId())); return m_trainers[trainerCount() - 1]; } @@ -1943,25 +1943,25 @@ Type* Pokemod::newType() { int i; m_types.append(new Type(this, i = newTypeId())); - m_typeChart.addColumn(Frac(1, 1)); - m_typeChart.addRow(Frac(1, 1)); + m_typeChart.addColumn(Fraction(1, 1)); + m_typeChart.addRow(Fraction(1, 1)); return m_types[typeCount() - 1]; } Type* Pokemod::newType(const QDomElement& xml) { int i; - m_types.append(new Type(this, xml, i = newTypeId())); - m_typeChart.addColumn(Frac(1, 1)); - m_typeChart.addRow(Frac(1, 1)); + m_types.append(new Type(xml, this, i = newTypeId())); + m_typeChart.addColumn(Fraction(1, 1)); + m_typeChart.addRow(Fraction(1, 1)); return m_types[typeCount() - 1]; } Type* Pokemod::newType(const Type& type) { - m_types.append(new Type(this, type, newTypeId())); - m_typeChart.addColumn(Frac(1, 1)); - m_typeChart.addRow(Frac(1, 1)); + m_types.append(new Type(type, this, newTypeId())); + m_typeChart.addColumn(Fraction(1, 1)); + m_typeChart.addRow(Fraction(1, 1)); return m_types[typeCount() - 1]; } |
