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 /pokemodr/PokeModTreeItem.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 'pokemodr/PokeModTreeItem.cpp')
| -rw-r--r-- | pokemodr/PokeModTreeItem.cpp | 332 |
1 files changed, 167 insertions, 165 deletions
diff --git a/pokemodr/PokeModTreeItem.cpp b/pokemodr/PokeModTreeItem.cpp index 5a237f70..bfed8e1b 100644 --- a/pokemodr/PokeModTreeItem.cpp +++ b/pokemodr/PokeModTreeItem.cpp @@ -1,32 +1,29 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: pokegen/PokeModTreeItem.cpp -// Purpose: Subclass of QTreeWidgetItem that allows information to be -// tacked on as well -// Author: Ben Boeckel -// Modified by: Ben Boeckel -// Created: Sat Feb 23 18:44:25 2008 -// Copyright: ©2007-2008 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 3 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, see <http://www.gnu.org/licenses/>. -///////////////////////////////////////////////////////////////////////////// +/* + * Copyright 2008 Ben Boeckel <MathStuf@gmail.com> + * + * 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 3 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, see <http://www.gnu.org/licenses/>. + */ +// KDE includes #include <kaction.h> #include <kmenu.h> +// Qt includes #include <QPoint> #include <QString> +// Pokemod includes #include <Ability.h> #include <AbilityEffect.h> #include <Author.h> @@ -61,6 +58,7 @@ #include <Trainer.h> #include <Type.h> +// PokeModr includes #include "AbilityUI.h" // #include "AbilityEffectUI.h" #include "AuthorUI.h" @@ -95,211 +93,215 @@ #include "TrainerUI.h" #include "TypeUI.h" +// Header include #include "PokeModTreeItem.h" +// FIXME: scrap for a better solution + +/* void PokeModTreeItem::update() { if (text(0).isEmpty()) { - QString name(obj->getClassName()); + QString name(m_object->className()); if (name == "Ability") - new PokeModTreeItem(this, obj, "Effects"); + new PokeModTreeItem(this, m_object, "Effects"); else if (name == "CoinList") - new PokeModTreeItem(this, obj, "Objects"); + new PokeModTreeItem(this, m_object, "Objects"); else if (name == "Item") - new PokeModTreeItem(this, obj, "Effects"); + new PokeModTreeItem(this, m_object, "Effects"); else if (name == "Map") { - new PokeModTreeItem(this, obj, "Effects"); - new PokeModTreeItem(this, obj, "Trainers"); - new PokeModTreeItem(this, obj, "Warps"); - new PokeModTreeItem(this, obj, "Wild Lists"); + new PokeModTreeItem(this, m_object, "Effects"); + new PokeModTreeItem(this, m_object, "Trainers"); + new PokeModTreeItem(this, m_object, "Warps"); + new PokeModTreeItem(this, m_object, "Wild Lists"); } else if (name == "MapTrainer") - new PokeModTreeItem(this, obj, "Team Members"); + new PokeModTreeItem(this, m_object, "Team Members"); else if (name == "MapWildList") - new PokeModTreeItem(this, obj, "Encounters"); + new PokeModTreeItem(this, m_object, "Encounters"); else if (name == "Move") - new PokeModTreeItem(this, obj, "Effects"); + new PokeModTreeItem(this, m_object, "Effects"); else if (name == "Pokemod") { - new PokeModTreeItem(this, static_cast<Pokemod*>(obj)->getRules()); - new PokeModTreeItem(this, obj, "Abilities"); - new PokeModTreeItem(this, obj, "Authors"); - new PokeModTreeItem(this, obj, "Badges"); - new PokeModTreeItem(this, obj, "Coin Lists"); - new PokeModTreeItem(this, obj, "Dialogs"); - new PokeModTreeItem(this, obj, "Egg Groups"); - new PokeModTreeItem(this, obj, "Items"); - new PokeModTreeItem(this, obj, "Item Types"); - new PokeModTreeItem(this, obj, "Maps"); - new PokeModTreeItem(this, obj, "Moves"); - new PokeModTreeItem(this, obj, "Natures"); - new PokeModTreeItem(this, obj, "Species"); - new PokeModTreeItem(this, obj, "Stores"); - new PokeModTreeItem(this, obj, "Tiles"); - new PokeModTreeItem(this, obj, "Times"); - new PokeModTreeItem(this, obj, "Trainers"); - new PokeModTreeItem(this, obj, "Types"); + new PokeModTreeItem(this, static_cast<Pokemod*>(m_object)->rules()); + new PokeModTreeItem(this, m_object, "Abilities"); + new PokeModTreeItem(this, m_object, "Authors"); + new PokeModTreeItem(this, m_object, "Badges"); + new PokeModTreeItem(this, m_object, "Coin Lists"); + new PokeModTreeItem(this, m_object, "Dialogs"); + new PokeModTreeItem(this, m_object, "Egg Groups"); + new PokeModTreeItem(this, m_object, "Items"); + new PokeModTreeItem(this, m_object, "Item Types"); + new PokeModTreeItem(this, m_object, "Maps"); + new PokeModTreeItem(this, m_object, "Moves"); + new PokeModTreeItem(this, m_object, "Natures"); + new PokeModTreeItem(this, m_object, "Species"); + new PokeModTreeItem(this, m_object, "Stores"); + new PokeModTreeItem(this, m_object, "Tiles"); + new PokeModTreeItem(this, m_object, "Times"); + new PokeModTreeItem(this, m_object, "Trainers"); + new PokeModTreeItem(this, m_object, "Types"); } else if (name == "Species") { - new PokeModTreeItem(this, obj, "Abilities"); - new PokeModTreeItem(this, obj, "Evolutions"); - new PokeModTreeItem(this, obj, "Items"); - new PokeModTreeItem(this, obj, "Moves"); + new PokeModTreeItem(this, m_object, "Abilities"); + new PokeModTreeItem(this, m_object, "Evolutions"); + new PokeModTreeItem(this, m_object, "Items"); + new PokeModTreeItem(this, m_object, "Moves"); } } else { - QString name(obj->getClassName()); + QString name(obj->className()); if (name == "Ability") { - Ability* a = static_cast<Ability*>(obj); - for (int i = 0; i < a->getEffectCount(); ++i) - new PokeModTreeItem(this, a->getEffect(i)); + Ability* ability = static_cast<Ability*>(m_object); + for (int i = 0; i < ability->effectCount(); ++i) + new PokeModTreeItem(this, ability->effect(i)); } else if (name == "CoinList") { - CoinList* c = static_cast<CoinList*>(obj); - for (int i = 0; i < c->getItemCount(); ++i) - new PokeModTreeItem(this, c->getItem(i)); + CoinList* coinList = static_cast<CoinList*>(m_object); + for (int i = 0; i < coinList->itemCount(); ++i) + new PokeModTreeItem(this, coinList->item(i)); } else if (name == "Item") { - Item* it = static_cast<Item*>(obj); - for (int i = 0; i < it->getEffectCount(); ++i) - new PokeModTreeItem(this, it->getEffect(i)); + Item* item = static_cast<Item*>(m_object); + for (int i = 0; i < item->effectCount(); ++i) + new PokeModTreeItem(this, item->effect(i)); } else if (name == "Map") { - Map* m = static_cast<Map*>(obj); + Map* map = static_cast<Map*>(m_object); if (text(0) == "Effects") { - for (int i = 0; i < m->getEffectCount(); ++i) - new PokeModTreeItem(this, m->getEffect(i)); + for (int i = 0; i < map->effectCount(); ++i) + new PokeModTreeItem(this, map->effect(i)); } else if (text(0) == "Trainers") { - for (int i = 0; i < m->getTrainerCount(); ++i) - new PokeModTreeItem(this, m->getTrainer(i)); + for (int i = 0; i < map->trainerCount(); ++i) + new PokeModTreeItem(this, map->trainer(i)); } else if (text(0) == "Warps") { - for (int i = 0; i < m->getWarpCount(); ++i) - new PokeModTreeItem(this, m->getWarp(i)); + for (int i = 0; i < m->warpCount(); ++i) + new PokeModTreeItem(this, m->warp(i)); } else if (text(0) == "Wild Lists") { - for (int i = 0; i < m->getWildListCount(); ++i) - new PokeModTreeItem(this, m->getWildList(i)); + for (int i = 0; i < m->wildListCount(); ++i) + new PokeModTreeItem(this, m->wildList(i)); } } else if (name == "MapTrainer") { MapTrainer* t = static_cast<MapTrainer*>(obj); - for (int i = 0; i < t->getTeamMemberCount(); ++i) - new PokeModTreeItem(this, t->getTeamMember(i)); + for (int i = 0; i < t->teamMemberCount(); ++i) + new PokeModTreeItem(this, t->teamMember(i)); } else if (name == "MapWildList") { MapWildList* w = static_cast<MapWildList*>(obj); - for (int i = 0; i < w->getEncounterCount(); ++i) - new PokeModTreeItem(this, w->getEncounter(i)); + for (int i = 0; i < w->encounterCount(); ++i) + new PokeModTreeItem(this, w->encounter(i)); } else if (name == "Move") { Move* m = static_cast<Move*>(obj); - for (int i = 0; i < m->getEffectCount(); ++i) - new PokeModTreeItem(this, m->getEffect(i)); + for (int i = 0; i < m->effectCount(); ++i) + new PokeModTreeItem(this, m->effect(i)); } else if (name == "Pokemod") { Pokemod* p = static_cast<Pokemod*>(obj); if (text(0) == "Abilities") { - for (int i = 0; i < p->getAbilityCount(); ++i) - new PokeModTreeItem(this, p->getAbility(i)); + for (int i = 0; i < p->abilityCount(); ++i) + new PokeModTreeItem(this, p->ability(i)); } else if (text(0) == "Authors") { - for (int i = 0; i < p->getAuthorCount(); ++i) - new PokeModTreeItem(this, p->getAuthor(i)); + for (int i = 0; i < p->authorCount(); ++i) + new PokeModTreeItem(this, p->author(i)); } else if (text(0) == "Badges") { - for (int i = 0; i < p->getBadgeCount(); ++i) - new PokeModTreeItem(this, p->getBadge(i)); + for (int i = 0; i < p->badgeCount(); ++i) + new PokeModTreeItem(this, p->badge(i)); } else if (text(0) == "Coin Lists") { - for (int i = 0; i < p->getCoinListCount(); ++i) - new PokeModTreeItem(this, p->getCoinList(i)); + for (int i = 0; i < p->coinListCount(); ++i) + new PokeModTreeItem(this, p->coinList(i)); } else if (text(0) == "Dialogs") { - for (int i = 0; i < p->getDialogCount(); ++i) - new PokeModTreeItem(this, p->getDialog(i)); + for (int i = 0; i < p->dialogCount(); ++i) + new PokeModTreeItem(this, p->dialog(i)); } else if (text(0) == "Egg Groups") { - for (int i = 0; i < p->getEggGroupCount(); ++i) - new PokeModTreeItem(this, p->getEggGroup(i)); + for (int i = 0; i < p->eggGroupCount(); ++i) + new PokeModTreeItem(this, p->eggGroup(i)); } else if (text(0) == "Items") { - for (int i = 0; i < p->getItemCount(); ++i) - new PokeModTreeItem(this, p->getItem(i)); + for (int i = 0; i < p->itemCount(); ++i) + new PokeModTreeItem(this, p->item(i)); } else if (text(0) == "Item Types") { - for (int i = 0; i < p->getItemTypeCount(); ++i) - new PokeModTreeItem(this, p->getItemType(i)); + for (int i = 0; i < p->itemTypeCount(); ++i) + new PokeModTreeItem(this, p->itemType(i)); } else if (text(0) == "Maps") { - for (int i = 0; i < p->getMapCount(); ++i) - new PokeModTreeItem(this, p->getMap(i)); + for (int i = 0; i < p->mapCount(); ++i) + new PokeModTreeItem(this, p->map(i)); } else if (text(0) == "Moves") { - for (int i = 0; i < p->getMoveCount(); ++i) - new PokeModTreeItem(this, p->getMove(i)); + for (int i = 0; i < p->moveCount(); ++i) + new PokeModTreeItem(this, p->move(i)); } else if (text(0) == "Natures") { - for (int i = 0; i < p->getNatureCount(); ++i) - new PokeModTreeItem(this, p->getNature(i)); + for (int i = 0; i < p->natureCount(); ++i) + new PokeModTreeItem(this, p->nature(i)); } else if (text(0) == "Species") { - for (int i = 0; i < p->getSpeciesCount(); ++i) - new PokeModTreeItem(this, p->getSpecies(i)); + for (int i = 0; i < p->speciesCount(); ++i) + new PokeModTreeItem(this, p->species(i)); } else if (text(0) == "Stores") { - for (int i = 0; i < p->getStoreCount(); ++i) - new PokeModTreeItem(this, p->getStore(i)); + for (int i = 0; i < p->storeCount(); ++i) + new PokeModTreeItem(this, p->store(i)); } else if (text(0) == "Tiles") { - for (int i = 0; i < p->getTileCount(); ++i) - new PokeModTreeItem(this, p->getTile(i)); + for (int i = 0; i < p->tileCount(); ++i) + new PokeModTreeItem(this, p->tile(i)); } else if (text(0) == "Times") { - for (int i = 0; i < p->getTimeCount(); ++i) - new PokeModTreeItem(this, p->getTime(i)); + for (int i = 0; i < p->timeCount(); ++i) + new PokeModTreeItem(this, p->time(i)); } else if (text(0) == "Trainers") { - for (int i = 0; i < p->getTrainerCount(); ++i) - new PokeModTreeItem(this, p->getTrainer(i)); + for (int i = 0; i < p->trainerCount(); ++i) + new PokeModTreeItem(this, p->trainer(i)); } else if (text(0) == "Types") { - for (int i = 0; i < p->getTypeCount(); ++i) - new PokeModTreeItem(this, p->getType(i)); + for (int i = 0; i < p->typeCount(); ++i) + new PokeModTreeItem(this, p->type(i)); } } else if (name == "Species") @@ -307,23 +309,23 @@ void PokeModTreeItem::update() Species* s = static_cast<Species*>(obj); if (text(0) == "Abilities") { - for (int i = 0; i < s->getAbilityCount(); ++i) - new PokeModTreeItem(this, s->getAbility(i)); + for (int i = 0; i < s->abilityCount(); ++i) + new PokeModTreeItem(this, s->ability(i)); } else if (text(0) == "Evolutions") { - for (int i = 0; i < s->getEvolutionCount(); ++i) - new PokeModTreeItem(this, s->getEvolution(i)); + for (int i = 0; i < s->evolutionCount(); ++i) + new PokeModTreeItem(this, s->evolution(i)); } else if (text(0) == "Items") { - for (int i = 0; i < s->getItemCount(); ++i) - new PokeModTreeItem(this, s->getItem(i)); + for (int i = 0; i < s->itemCount(); ++i) + new PokeModTreeItem(this, s->item(i)); } else if (text(0) == "Moves") { - for (int i = 0; i < s->getMoveCount(); ++i) - new PokeModTreeItem(this, s->getMove(i)); + for (int i = 0; i < s->moveCount(); ++i) + new PokeModTreeItem(this, s->move(i)); } } obj = NULL; @@ -337,7 +339,7 @@ void PokeModTreeItem::init(QWidget* pnt) setChildIndicatorPolicy(QTreeWidgetItem::QTreeWidgetItem::DontShowIndicatorWhenChildless); if (obj) { - QString name(obj->getClassName()); + QString name(obj->className()); #define IF_IS_CLASS(class) if (name == #class) ui = new class##UI(static_cast< ::class* >(obj), pnt); IF_IS_CLASS(Ability) // else IF_IS_CLASS(AbilityEffect) @@ -383,86 +385,86 @@ void PokeModTreeItem::updateName() { if (!obj) return; - QString name(obj->getClassName()); + QString name(obj->className()); QString text; if (name == "Ability") - text = static_cast<Ability*>(obj)->getName(); + text = static_cast<Ability*>(obj)->name(); else if (name == "AbilityEffect") - text = AbilityEffect::EffectStr.at(static_cast<AbilityEffect*>(obj)->getEffect()); + text = AbilityEffect::EffectStr.at(static_cast<AbilityEffect*>(obj)->effect()); else if (name == "Author") - text = static_cast<Author*>(obj)->getName(); + text = static_cast<Author*>(obj)->name(); else if (name == "Badge") - text = static_cast<Badge*>(obj)->getName(); + text = static_cast<Badge*>(obj)->name(); else if (name == "CoinList") - text = static_cast<CoinList*>(obj)->getName(); + text = static_cast<CoinList*>(obj)->name(); else if (name == "CoinListObject") { const CoinListObject* o = static_cast<CoinListObject*>(obj); - if (o->getType() == CoinListObject::Item) - text = obj->getPokemod()->getItem(o->getObject())->getName(); + if (o->type() == CoinListObject::Item) + text = obj->pokemod()->item(o->object())->name(); else - text = obj->getPokemod()->getSpecies(o->getObject())->getName(); + text = obj->pokemod()->species(o->object())->name(); } else if (name == "Dialog") - text = static_cast<Dialog*>(obj)->getDialog().mid(0, 25); + text = static_cast<Dialog*>(obj)->dialog().mid(0, 25); else if (name == "EggGroup") - text = static_cast<EggGroup*>(obj)->getName(); + text = static_cast<EggGroup*>(obj)->name(); else if (name == "Item") - text = static_cast<Item*>(obj)->getName(); + text = static_cast<Item*>(obj)->name(); else if (name == "ItemEffect") - text = ItemEffect::EffectStr.at(static_cast<ItemEffect*>(obj)->getEffect()); + text = ItemEffect::EffectStr.at(static_cast<ItemEffect*>(obj)->effect()); else if (name == "ItemType") - text = static_cast< ::ItemType* >(obj)->getName(); + text = static_cast< ::ItemType* >(obj)->name(); else if (name == "Map") - text = static_cast<Map*>(obj)->getName(); + text = static_cast<Map*>(obj)->name(); else if (name == "MapEffect") - text = static_cast<MapEffect*>(obj)->getName(); + text = static_cast<MapEffect*>(obj)->name(); else if (name == "MapTrainer") - text = static_cast<MapTrainer*>(obj)->getName(); + text = static_cast<MapTrainer*>(obj)->name(); else if (name == "MapTrainerTeamMember") { const MapTrainerTeamMember* t = static_cast<MapTrainerTeamMember*>(obj); - text = QString("Lv. %1 %2").arg(t->getLevel()).arg(obj->getPokemod()->getSpecies(t->getSpecies())->getName()); + text = QString("Lv. %1 %2").arg(t->level()).arg(obj->pokemod()->species(t->species())->name()); } else if (name == "MapWarp") - text = static_cast<MapWarp*>(obj)->getName(); + text = static_cast<MapWarp*>(obj)->name(); else if (name == "MapWildList") - text = MapWildList::ControlStr.at(static_cast<MapWildList*>(obj)->getControl()); + text = MapWildList::ControlStr.at(static_cast<MapWildList*>(obj)->control()); else if (name == "MapWildListEncounter") { const MapWildListEncounter* e = static_cast<MapWildListEncounter*>(obj); - text = QString("Lv. %1 %2").arg(e->getLevel()).arg(obj->getPokemod()->getSpecies(e->getSpecies())->getName()); + text = QString("Lv. %1 %2").arg(e->level()).arg(obj->pokemod()->species(e->species())->name()); } else if (name == "Move") - text = static_cast<Move*>(obj)->getName(); + text = static_cast<Move*>(obj)->name(); else if (name == "MoveEffect") - text = MoveEffect::EffectStr.at(static_cast<MoveEffect*>(obj)->getEffect()); + text = MoveEffect::EffectStr.at(static_cast<MoveEffect*>(obj)->effect()); else if (name == "Nature") - text = static_cast<Nature*>(obj)->getName(); + text = static_cast<Nature*>(obj)->name(); else if (name == "Pokemod") - text = static_cast<Pokemod*>(obj)->getTitle(); + text = static_cast<Pokemod*>(obj)->title(); else if (name == "Rules") text = "Rules"; else if (name == "Species") - text = static_cast<Species*>(obj)->getName(); + text = static_cast<Species*>(obj)->name(); else if (name == "SpeciesAbility") - text = obj->getPokemod()->getAbility(static_cast<SpeciesAbility*>(obj)->getAbility())->getName(); + text = obj->pokemod()->ability(static_cast<SpeciesAbility*>(obj)->ability())->name(); else if (name == "SpeciesEvolution") - text = obj->getPokemod()->getSpecies(static_cast<SpeciesEvolution*>(obj)->getSpecies())->getName(); + text = obj->pokemod()->species(static_cast<SpeciesEvolution*>(obj)->species())->name(); else if (name == "SpeciesItem") - text = obj->getPokemod()->getItem(static_cast<SpeciesItem*>(obj)->getItem())->getName(); + text = obj->pokemod()->item(static_cast<SpeciesItem*>(obj)->item())->name(); else if (name == "SpeciesMove") - text = obj->getPokemod()->getMove(static_cast<SpeciesMove*>(obj)->getMove())->getName(); + text = obj->pokemod()->move(static_cast<SpeciesMove*>(obj)->move())->name(); else if (name == "Store") - text = static_cast<Store*>(obj)->getName(); + text = static_cast<Store*>(obj)->name(); else if (name == "Tile") - text = static_cast<Tile*>(obj)->getName(); + text = static_cast<Tile*>(obj)->name(); else if (name == "Time") - text = static_cast<Time*>(obj)->getName(); + text = static_cast<Time*>(obj)->name(); else if (name == "Trainer") - text = static_cast<Trainer*>(obj)->getName(); + text = static_cast<Trainer*>(obj)->name(); else if (name == "Type") - text = static_cast< ::Type* >(obj)->getName(); + text = static_cast< ::Type* >(obj)->name(); setText(0, text); } @@ -474,8 +476,8 @@ Object* PokeModTreeItem::copy() { if (obj) { - QString name(obj->getClassName()); -#define IF_IS_CLASS(class) if (name == #class) return new ::class(obj->getPokemod(), *static_cast< ::class* >(obj), obj->getId()); + QString name(obj->className()); +#define IF_IS_CLASS(class) if (name == #class) return new ::class(obj->pokemod(), *static_cast< ::class* >(obj), obj->id()); IF_IS_CLASS(Ability) else IF_IS_CLASS(AbilityEffect) else IF_IS_CLASS(Author) @@ -498,7 +500,7 @@ Object* PokeModTreeItem::copy() else IF_IS_CLASS(MoveEffect) else IF_IS_CLASS(Nature) else if (name == "Pokemod") return new Pokemod(*static_cast<Pokemod*>(obj)); - else if (name == "Rules") return new Rules(obj->getPokemod()); + else if (name == "Rules") return new Rules(obj->pokemod()); else IF_IS_CLASS(Species) else IF_IS_CLASS(SpeciesAbility) else IF_IS_CLASS(SpeciesEvolution) @@ -519,8 +521,8 @@ Object* PokeModTreeItem::cut() // TODO: actually cut the item if (obj) { - QString name(obj->getClassName()); -#define IF_IS_CLASS(class) if (name == #class) return new ::class(obj->getPokemod(), *static_cast< ::class* >(obj), obj->getId()); + QString name(obj->className()); +#define IF_IS_CLASS(class) if (name == #class) return new ::class(obj->pokemod(), *static_cast< ::class* >(obj), obj->id()); IF_IS_CLASS(Ability) else IF_IS_CLASS(AbilityEffect) else IF_IS_CLASS(Author) @@ -543,7 +545,7 @@ Object* PokeModTreeItem::cut() else IF_IS_CLASS(MoveEffect) else IF_IS_CLASS(Nature) else if (name == "Pokemod") return new Pokemod(*static_cast<Pokemod*>(obj)); - else if (name == "Rules") return new Rules(obj->getPokemod()); + else if (name == "Rules") return new Rules(obj->pokemod()); else IF_IS_CLASS(Species) else IF_IS_CLASS(SpeciesAbility) else IF_IS_CLASS(SpeciesEvolution) @@ -557,4 +559,4 @@ Object* PokeModTreeItem::cut() #undef IF_IS_CLASS } return NULL; -} +}*/ |
