diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2008-09-05 20:41:05 +0000 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2008-09-05 20:41:05 +0000 |
| commit | b81f5bffa2772eb9bd3c67fb35485ab1ee2d96e7 (patch) | |
| tree | 6609f31b1635d948cf7a216c7fea72cfb3c905a0 /pokescripting/SpeciesWrapper.cpp | |
| parent | b99ffef4aa68dd5f0af64de9aec0f610e267d8cc (diff) | |
| download | sigen-b81f5bffa2772eb9bd3c67fb35485ab1ee2d96e7.tar.gz sigen-b81f5bffa2772eb9bd3c67fb35485ab1ee2d96e7.tar.xz sigen-b81f5bffa2772eb9bd3c67fb35485ab1ee2d96e7.zip | |
[FIX] Moving stuff for the move to the new name, Sigma Game Engine (sigen for short)
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@249 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokescripting/SpeciesWrapper.cpp')
| -rw-r--r-- | pokescripting/SpeciesWrapper.cpp | 237 |
1 files changed, 0 insertions, 237 deletions
diff --git a/pokescripting/SpeciesWrapper.cpp b/pokescripting/SpeciesWrapper.cpp deleted file mode 100644 index e80c364d..00000000 --- a/pokescripting/SpeciesWrapper.cpp +++ /dev/null @@ -1,237 +0,0 @@ -/* - * 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/>. - */ - -// Header include -#include "SpeciesWrapper.h" - -// Pokescripting includes -#include "PokemodWrapper.h" -#include "SpeciesAbilityWrapper.h" -#include "SpeciesItemWrapper.h" -#include "SpeciesMoveWrapper.h" - -Pokescripting::SpeciesWrapper* Pokescripting::SpeciesWrapper::create(const Pokemod::Species* species, PokemodWrapper* parent) -{ - if (!m_instances.contains(Signiture(parent, species->id()))) - m_instances[Signiture(parent, species->id())] = new SpeciesWrapper(species, parent); - return qobject_cast<SpeciesWrapper*>(m_instances[Signiture(parent, species->id())]); -} - -Pokescripting::SpeciesWrapper::SpeciesWrapper(const Pokemod::Species* species, PokemodWrapper* parent) : - ObjectWrapper(species, parent), - m_species(species) -{ -} - -Pokemod::Hat<Pokescripting::AbilityWrapper*> Pokescripting::SpeciesWrapper::abilityHat() -{ - Pokemod::Hat<AbilityWrapper*> hat; - for (int i = 0; i < abilityCount(); ++i) - hat.add(ability(i)->ability(), ability(i)->weight()); - return hat; -} - -Pokemod::Hat<Pokescripting::ItemWrapper*> Pokescripting::SpeciesWrapper::itemHat() -{ - Pokemod::Hat<ItemWrapper*> hat; - for (int i = 0; i < itemCount(); ++i) - hat.add(item(i)->item(), item(i)->weight()); - return hat; -} - -Pokemod::Species::Style Pokescripting::SpeciesWrapper::growth(const QString& name) const -{ - if (name == "Fluctuating") - return Pokemod::Species::Fluctuating; - else if (name == "Fading") - return Pokemod::Species::Fading; - else if (name == "Slow") - return Pokemod::Species::Slow; - else if (name == "Normal") - return Pokemod::Species::Normal; - else if (name == "Fast") - return Pokemod::Species::Fast; - else if (name == "Erratic") - return Pokemod::Species::Erratic; - return QVariant(-1).value<Pokemod::Species::Style>(); -} - -QString Pokescripting::SpeciesWrapper::name() const -{ - return m_species->name(); -} - -int Pokescripting::SpeciesWrapper::baseStat(const Pokemod::Stat stat) const -{ - return m_species->baseStat(stat); -} - -int Pokescripting::SpeciesWrapper::effortValue(const Pokemod::Stat stat) const -{ - return m_species->effortValue(stat); -} - -Pokemod::Species::Style Pokescripting::SpeciesWrapper::growth() const -{ - return m_species->growth(); -} - -int Pokescripting::SpeciesWrapper::experienceValue() const -{ - return m_species->experienceValue(); -} - -int Pokescripting::SpeciesWrapper::catchValue() const -{ - return m_species->catchValue(); -} - -Pokemod::Fraction Pokescripting::SpeciesWrapper::runChance() const -{ - if (value("runChance").canConvert<Pokemod::Fraction>()) - return value("runChance").value<Pokemod::Fraction>(); - return m_species->runChance(); -} - -Pokemod::Fraction Pokescripting::SpeciesWrapper::fleeChance() const -{ - if (value("fleeChance").canConvert<Pokemod::Fraction>()) - return value("fleeChance").value<Pokemod::Fraction>(); - return m_species->fleeChance(); -} - -Pokemod::Fraction Pokescripting::SpeciesWrapper::itemChance() const -{ - if (value("itemChance").canConvert<Pokemod::Fraction>()) - return value("itemChance").value<Pokemod::Fraction>(); - return m_species->itemChance(); -} - -int Pokescripting::SpeciesWrapper::pokedexNumber() const -{ - return m_species->pokedexNumber(); -} - -int Pokescripting::SpeciesWrapper::weight() const -{ - return m_species->weight(); -} - -int Pokescripting::SpeciesWrapper::height() const -{ - return m_species->height(); -} - -QString Pokescripting::SpeciesWrapper::pokedexEntry() const -{ - return m_species->pokedexEntry(); -} - -Pokescripting::SpriteWrapper* Pokescripting::SpeciesWrapper::frontMaleSprite() -{ - return pokemod()->sprite(m_species->frontMaleSprite()); -} - -Pokescripting::SpriteWrapper* Pokescripting::SpeciesWrapper::backMaleSprite() -{ - return pokemod()->sprite(m_species->backMaleSprite()); -} - -Pokescripting::SpriteWrapper* Pokescripting::SpeciesWrapper::frontFemaleSprite() -{ - return pokemod()->sprite(m_species->frontFemaleSprite()); -} - -Pokescripting::SpriteWrapper* Pokescripting::SpeciesWrapper::backFemaleSprite() -{ - return pokemod()->sprite(m_species->backFemaleSprite()); -} - -Pokescripting::SkinWrapper* Pokescripting::SpeciesWrapper::skin() -{ - return pokemod()->skin(m_species->skin()); -} - -Pokemod::Fraction Pokescripting::SpeciesWrapper::genderFactor() const -{ - return m_species->genderFactor(); -} - -int Pokescripting::SpeciesWrapper::eggSpecies() const -{ - if (value("eggSpecies").canConvert<int>()) - return value("eggSpecies").toInt(); - return m_species->eggSpecies(); -} - -int Pokescripting::SpeciesWrapper::eggSteps() const -{ - return m_species->eggSteps(); -} - -QList<Pokescripting::TypeWrapper*> Pokescripting::SpeciesWrapper::types() -{ - QList<int> typeIds = m_species->types(); - QList<TypeWrapper*> types; - foreach (int id, typeIds) - types.append(pokemod()->type(id)); - return types; -} - -QList<Pokescripting::EggGroupWrapper*> Pokescripting::SpeciesWrapper::eggGroups() -{ - QList<int> eggGroupIds = m_species->eggGroups(); - QList<EggGroupWrapper*> eggGroups; - foreach (int id, eggGroupIds) - eggGroups.append(pokemod()->eggGroup(id)); - return eggGroups; -} - -Pokemod::Script Pokescripting::SpeciesWrapper::evolution() const -{ - return m_species->evolution(); -} - -Pokescripting::SpeciesAbilityWrapper* Pokescripting::SpeciesWrapper::ability(const int index) -{ - return SpeciesAbilityWrapper::create(m_species->ability(index), this); -} - -int Pokescripting::SpeciesWrapper::abilityCount() const -{ - return m_species->abilityCount(); -} - -Pokescripting::SpeciesItemWrapper* Pokescripting::SpeciesWrapper::item(const int index) -{ - return SpeciesItemWrapper::create(m_species->item(index), this); -} - -int Pokescripting::SpeciesWrapper::itemCount() const -{ - return m_species->itemCount(); -} - -Pokescripting::SpeciesMoveWrapper* Pokescripting::SpeciesWrapper::move(const int index) -{ - return SpeciesMoveWrapper::create(m_species->move(index), this); -} - -int Pokescripting::SpeciesWrapper::moveCount() const -{ - return m_species->moveCount(); -} |
