diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2008-04-24 18:46:14 +0000 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2008-04-24 18:46:14 +0000 |
| commit | d7b6b0627a7d5e0875a263bf9501506a3d8da450 (patch) | |
| tree | 4347a259fa97a8e34b6dbc57cd658bb70c55f2dd /pokemodr/models/PokemodModel.cpp | |
| parent | 8178711f67288bf43eeb80dce15eaa65a1d840f7 (diff) | |
| download | sigen-d7b6b0627a7d5e0875a263bf9501506a3d8da450.tar.gz sigen-d7b6b0627a7d5e0875a263bf9501506a3d8da450.tar.xz sigen-d7b6b0627a7d5e0875a263bf9501506a3d8da450.zip | |
[ADD] New classes for the models
[FIX] Stuff cleaned up for better profiling (no inlining until profiler says so)
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@105 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemodr/models/PokemodModel.cpp')
| -rw-r--r-- | pokemodr/models/PokemodModel.cpp | 768 |
1 files changed, 768 insertions, 0 deletions
diff --git a/pokemodr/models/PokemodModel.cpp b/pokemodr/models/PokemodModel.cpp new file mode 100644 index 00000000..5c7d2f4b --- /dev/null +++ b/pokemodr/models/PokemodModel.cpp @@ -0,0 +1,768 @@ +/* + * 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/>. + */ + +// Model includes +#include "AbilityModel.h" +// #include "BadgeModel.h" +// #include "CoinListModel.h" +// #include "DialogModel.h" +// #include "EggGroupModel.h" +// #include "ItemModel.h" +// #include "ItemTypeModel.h" +// #include "MapModel.h" +// #include "MoveModel.h" +// #include "NatureModel.h" +// #include "SpeciesModel.h" +// #include "StoreModel.h" +// #include "TileModel.h" +// #include "TimeModel.h" +// #include "TrainerModel.h" +// #include "TypeModel.h" + +// Header include +#include "PokemodModel.h" + +AbilityGroupModel::AbilityGroupModel(BaseModel* parent, Object* object) : + GroupModel(parent, object, "Abilities") +{ + // TODO: construct +} + +AbilityGroupModel::~AbilityGroupModel() +{ + // TODO: destruct +} + +int AbilityGroupModel::rowCount() const +{ + // TODO: row count +} + +BaseModel* AbilityGroupModel::childItem(const int row) +{ + // TODO: child item +} + +int AbilityGroupModel::indexNumber() const +{ + return 1; +} + +bool AbilityGroupModel::insertRows(const int rows) +{ + // TODO: insert row +} + +bool AbilityGroupModel::removeRows(const int position, const int rows) +{ + // TODO: remove row +} + +// bool AbilityGroupModel::dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column); + +BadgeGroupModel::BadgeGroupModel(BaseModel* parent, Object* object) : + GroupModel(parent, object, "Badges") +{ + // TODO: construct +} + +BadgeGroupModel::~BadgeGroupModel() +{ + // TODO: destruct +} + +int BadgeGroupModel::rowCount() const +{ + // TODO: row count +} + +BaseModel* BadgeGroupModel::childItem(const int row) +{ + // TODO: child item +} + +int BadgeGroupModel::indexNumber() const +{ + return 1; +} + +bool BadgeGroupModel::insertRows(const int rows) +{ + // TODO: insert row +} + +bool BadgeGroupModel::removeRows(const int position, const int rows) +{ + // TODO: remove row +} + +// bool BadgeGroupModel::dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column); + +CoinListGroupModel::CoinListGroupModel(BaseModel* parent, Object* object) : + GroupModel(parent, object, "Coin Lists") +{ + // TODO: construct +} + +CoinListGroupModel::~CoinListGroupModel() +{ + // TODO: destruct +} + +int CoinListGroupModel::rowCount() const +{ + // TODO: row count +} + +BaseModel* CoinListGroupModel::childItem(const int row) +{ + // TODO: child item +} + +int CoinListGroupModel::indexNumber() const +{ + return 1; +} + +bool CoinListGroupModel::insertRows(const int rows) +{ + // TODO: insert row +} + +bool CoinListGroupModel::removeRows(const int position, const int rows) +{ + // TODO: remove row +} + +// bool CoinListGroupModel::dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column); + +DialogGroupModel::DialogGroupModel(BaseModel* parent, Object* object) : + GroupModel(parent, object, "Dialogs") +{ + // TODO: construct +} + +DialogGroupModel::~DialogGroupModel() +{ + // TODO: destruct +} + +int DialogGroupModel::rowCount() const +{ + // TODO: row count +} + +BaseModel* DialogGroupModel::childItem(const int row) +{ + // TODO: child item +} + +int DialogGroupModel::indexNumber() const +{ + return 1; +} + +bool DialogGroupModel::insertRows(const int rows) +{ + // TODO: insert row +} + +bool DialogGroupModel::removeRows(const int position, const int rows) +{ + // TODO: remove row +} + +// bool DialogGroupModel::dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column); + +EggGroupGroupModel::EggGroupGroupModel(BaseModel* parent, Object* object) : + GroupModel(parent, object, "Egg Groups") +{ + // TODO: construct +} + +EggGroupGroupModel::~EggGroupGroupModel() +{ + // TODO: destruct +} + +int EggGroupGroupModel::rowCount() const +{ + // TODO: row count +} + +BaseModel* EggGroupGroupModel::childItem(const int row) +{ + // TODO: child item +} + +int EggGroupGroupModel::indexNumber() const +{ + return 1; +} + +bool EggGroupGroupModel::insertRows(const int rows) +{ + // TODO: insert row +} + +bool EggGroupGroupModel::removeRows(const int position, const int rows) +{ + // TODO: remove row +} + +// bool EggGroupGroupModel::dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column); + +ItemGroupModel::ItemGroupModel(BaseModel* parent, Object* object) : + GroupModel(parent, object, "Items") +{ + // TODO: construct +} + +ItemGroupModel::~ItemGroupModel() +{ + // TODO: destruct +} + +int ItemGroupModel::rowCount() const +{ + // TODO: row count +} + +BaseModel* ItemGroupModel::childItem(const int row) +{ + // TODO: child item +} + +int ItemGroupModel::indexNumber() const +{ + return 1; +} + +bool ItemGroupModel::insertRows(const int rows) +{ + // TODO: insert row +} + +bool ItemGroupModel::removeRows(const int position, const int rows) +{ + // TODO: remove row +} + +// bool ItemGroupModel::dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column); + +ItemTypeGroupModel::ItemTypeGroupModel(BaseModel* parent, Object* object) : + GroupModel(parent, object, "Item Types") +{ + // TODO: construct +} + +ItemTypeGroupModel::~ItemTypeGroupModel() +{ + // TODO: destruct +} + +int ItemTypeGroupModel::rowCount() const +{ + // TODO: row count +} + +BaseModel* ItemTypeGroupModel::childItem(const int row) +{ + // TODO: child item +} + +int ItemTypeGroupModel::indexNumber() const +{ + return 1; +} + +bool ItemTypeGroupModel::insertRows(const int rows) +{ + // TODO: insert row +} + +bool ItemTypeGroupModel::removeRows(const int position, const int rows) +{ + // TODO: remove row +} + +// bool ItemTypeGroupModel::dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column); + +MapGroupModel::MapGroupModel(BaseModel* parent, Object* object) : + GroupModel(parent, object, "Maps") +{ + // TODO: construct +} + +MapGroupModel::~MapGroupModel() +{ + // TODO: destruct +} + +int MapGroupModel::rowCount() const +{ + // TODO: row count +} + +BaseModel* MapGroupModel::childItem(const int row) +{ + // TODO: child item +} + +int MapGroupModel::indexNumber() const +{ + return 1; +} + +bool MapGroupModel::insertRows(const int rows) +{ + // TODO: insert row +} + +bool MapGroupModel::removeRows(const int position, const int rows) +{ + // TODO: remove row +} + +// bool MapGroupModel::dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column); + +MoveGroupModel::MoveGroupModel(BaseModel* parent, Object* object) : + GroupModel(parent, object, "Moves") +{ + // TODO: construct +} + +MoveGroupModel::~MoveGroupModel() +{ + // TODO: destruct +} + +int MoveGroupModel::rowCount() const +{ + // TODO: row count +} + +BaseModel* MoveGroupModel::childItem(const int row) +{ + // TODO: child item +} + +int MoveGroupModel::indexNumber() const +{ + return 1; +} + +bool MoveGroupModel::insertRows(const int rows) +{ + // TODO: insert row +} + +bool MoveGroupModel::removeRows(const int position, const int rows) +{ + // TODO: remove row +} + +// bool MoveGroupModel::dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column); + +NatureGroupModel::NatureGroupModel(BaseModel* parent, Object* object) : + GroupModel(parent, object, "Natures") +{ + // TODO: construct +} + +NatureGroupModel::~NatureGroupModel() +{ + // TODO: destruct +} + +int NatureGroupModel::rowCount() const +{ + // TODO: row count +} + +BaseModel* NatureGroupModel::childItem(const int row) +{ + // TODO: child item +} + +int NatureGroupModel::indexNumber() const +{ + return 1; +} + +bool NatureGroupModel::insertRows(const int rows) +{ + // TODO: insert row +} + +bool NatureGroupModel::removeRows(const int position, const int rows) +{ + // TODO: remove row +} + +// bool NatureGroupModel::dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column); + +SpeciesGroupModel::SpeciesGroupModel(BaseModel* parent, Object* object) : + GroupModel(parent, object, "Species") +{ + // TODO: construct +} + +SpeciesGroupModel::~SpeciesGroupModel() +{ + // TODO: destruct +} + +int SpeciesGroupModel::rowCount() const +{ + // TODO: row count +} + +BaseModel* SpeciesGroupModel::childItem(const int row) +{ + // TODO: child item +} + +int SpeciesGroupModel::indexNumber() const +{ + return 1; +} + +bool SpeciesGroupModel::insertRows(const int rows) +{ + // TODO: insert row +} + +bool SpeciesGroupModel::removeRows(const int position, const int rows) +{ + // TODO: remove row +} + +// bool SpeciesGroupModel::dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column); + +StoreGroupModel::StoreGroupModel(BaseModel* parent, Object* object) : + GroupModel(parent, object, "Stores") +{ + // TODO: construct +} + +StoreGroupModel::~StoreGroupModel() +{ + // TODO: destruct +} + +int StoreGroupModel::rowCount() const +{ + // TODO: row count +} + +BaseModel* StoreGroupModel::childItem(const int row) +{ + // TODO: child item +} + +int StoreGroupModel::indexNumber() const +{ + return 1; +} + +bool StoreGroupModel::insertRows(const int rows) +{ + // TODO: insert row +} + +bool StoreGroupModel::removeRows(const int position, const int rows) +{ + // TODO: remove row +} + +// bool StoreGroupModel::dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column); + +TileGroupModel::TileGroupModel(BaseModel* parent, Object* object) : + GroupModel(parent, object, "Tiles") +{ + // TODO: construct +} + +TileGroupModel::~TileGroupModel() +{ + // TODO: destruct +} + +int TileGroupModel::rowCount() const +{ + // TODO: row count +} + +BaseModel* TileGroupModel::childItem(const int row) +{ + // TODO: child item +} + +int TileGroupModel::indexNumber() const +{ + return 1; +} + +bool TileGroupModel::insertRows(const int rows) +{ + // TODO: insert row +} + +bool TileGroupModel::removeRows(const int position, const int rows) +{ + // TODO: remove row +} + +// bool TileGroupModel::dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column); + +TimeGroupModel::TimeGroupModel(BaseModel* parent, Object* object) : + GroupModel(parent, object, "Times") +{ + // TODO: construct +} + +TimeGroupModel::~TimeGroupModel() +{ + // TODO: destruct +} + +int TimeGroupModel::rowCount() const +{ + // TODO: row count +} + +BaseModel* TimeGroupModel::childItem(const int row) +{ + // TODO: child item +} + +int TimeGroupModel::indexNumber() const +{ + return 1; +} + +bool TimeGroupModel::insertRows(const int rows) +{ + // TODO: insert row +} + +bool TimeGroupModel::removeRows(const int position, const int rows) +{ + // TODO: remove row +} + +// bool TimeGroupModel::dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column); + +TrainerGroupModel::TrainerGroupModel(BaseModel* parent, Object* object) : + GroupModel(parent, object, "Trainers") +{ + // TODO: construct +} + +TrainerGroupModel::~TrainerGroupModel() +{ + // TODO: destruct +} + +int TrainerGroupModel::rowCount() const +{ + // TODO: row count +} + +BaseModel* TrainerGroupModel::childItem(const int row) +{ + // TODO: child item +} + +int TrainerGroupModel::indexNumber() const +{ + return 1; +} + +bool TrainerGroupModel::insertRows(const int rows) +{ + // TODO: insert row +} + +bool TrainerGroupModel::removeRows(const int position, const int rows) +{ + // TODO: remove row +} + +// bool TrainerGroupModel::dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column); + +TypeGroupModel::TypeGroupModel(BaseModel* parent, Object* object) : + GroupModel(parent, object, "Types") +{ + // TODO: construct +} + +TypeGroupModel::~TypeGroupModel() +{ + // TODO: destruct +} + +int TypeGroupModel::rowCount() const +{ + // TODO: row count +} + +BaseModel* TypeGroupModel::childItem(const int row) +{ + // TODO: child item +} + +int TypeGroupModel::indexNumber() const +{ + return 1; +} + +bool TypeGroupModel::insertRows(const int rows) +{ + // TODO: insert row +} + +bool TypeGroupModel::removeRows(const int position, const int rows) +{ + // TODO: remove row +} + +// bool TypeGroupModel::dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column); + +PokemodModel::PokemodModel(BaseModel* parent, Object* object) : + ObjectModel(parent, object) +{ + Pokemod* pokemod = static_cast<Pokemod*>(m_object); +} + +PokemodModel::~PokemodModel() +{ + // TODO: destruct +} + +QVariant PokemodModel::data(int role) const +{ + if (role == Qt::DisplayRole) + return static_cast<Pokemod*>(m_object)->title(); + else if (role == Qt::UserRole) + { + QWidget* widget = new PokemodUI(static_cast<Pokemod*>(m_object), NULL); + return QVariant::fromValue(widget); + } + return QVariant(); +} + +int PokemodModel::rowCount() const +{ + return 17; +} + +bool PokemodModel::setData(const QVariant& value, int role) +{ + // TODO: set data +} + +BaseModel* PokemodModel::childItem(const int row) +{ + BaseModel* model; + switch (row) + { + case 0: + model = m_abilities; + break; + case 1: + model = m_badges; + break; + case 2: + model = m_coinLists; + break; + case 3: + model = m_dialogs; + break; + case 4: + model = m_eggGroups; + break; + case 5: + model = m_items; + break; + case 6: + model = m_itemTypes; + break; + case 7: + model = m_maps; + break; + case 8: + model = m_moves; + break; + case 9: + model = m_natures; + break; + case 10: + model = m_rules; + break; + case 11: + model = m_species; + break; + case 12: + model = m_stores; + break; + case 13: + model = m_tiles; + break; + case 14: + model = m_times; + break; + case 15: + model = m_trainers; + break; + case 16: + model = m_types; + break; + default: + model = NULL; + } + return model; +} + +int PokemodModel::indexNumber() const +{ + // TODO: get effect index + return m_object->pokemod()->abilityIndex(m_object->id()); +} + +bool PokemodModel::canInsertRows() const +{ + return false; +} + +bool PokemodModel::insertRows(const int rows) +{ + return false; +} + +bool PokemodModel::canRemoveRows() const +{ + return false; +} + +bool PokemodModel::removeRows(const int position, const int rows) +{ + return false; +} + +// bool PokemodModel::dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column); |
