diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2008-05-23 22:39:56 +0000 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2008-05-23 22:39:56 +0000 |
| commit | 0fe749eb04515ff7ee28cdc5d14c7be6f6fdeca4 (patch) | |
| tree | 61da8fe050b81a477c24fc481e5d6cb39f928e2f /pokemod | |
| parent | 793f2e539316e796968103617025320870f8c3ce (diff) | |
[ADD] Added UI classes for GlobalScript
[FIX] Script support is now in pokemodr
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@168 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemod')
| -rw-r--r-- | pokemod/MapWildList.h | 1 | ||||
| -rw-r--r-- | pokemod/Pokemod.cpp | 32 | ||||
| -rw-r--r-- | pokemod/Pokemod.h | 8 | ||||
| -rw-r--r-- | pokemod/SpeciesEvolution.cpp | 126 | ||||
| -rw-r--r-- | pokemod/SpeciesEvolution.h | 57 |
5 files changed, 0 insertions, 224 deletions
diff --git a/pokemod/MapWildList.h b/pokemod/MapWildList.h index cfc06fc3..22726f38 100644 --- a/pokemod/MapWildList.h +++ b/pokemod/MapWildList.h @@ -87,7 +87,6 @@ class MapWildList : public Object int m_control; Script m_script; QList<int> m_time; - QList<MapWildListEncounter*> m_encounters; }; diff --git a/pokemod/Pokemod.cpp b/pokemod/Pokemod.cpp index 0f52af1f..a0e86ced 100644 --- a/pokemod/Pokemod.cpp +++ b/pokemod/Pokemod.cpp @@ -65,8 +65,6 @@ Pokemod::Pokemod() : m_flySkin(192, 128), m_fishSkin(192, 128), m_surfFishSkin(192, 128), - m_superPCUname(""), - m_superPCPasswd(""), m_typeChart(0, 0), m_rules(new Rules(this)) { @@ -107,10 +105,6 @@ void Pokemod::validate() if (mapById(m_startMap)->warpIndex(m_startWarp) == INT_MAX) emit(error("Invalid starting warp")); } - if (m_superPCUname.isEmpty()) - emit(warning("Super PC username not defined")); - if (m_superPCPasswd.isEmpty()) - emit(warning("Super PC password not defined")); if ((m_typeChart.width() != typeCount()) || (m_typeChart.height() != typeCount())) emit(error("Type chart is invalid")); m_rules->validate(); @@ -395,8 +389,6 @@ void Pokemod::load(const QDomElement& xml, const int) LOAD(QPixmap, flySkin); LOAD(QPixmap, fishSkin); LOAD(QPixmap, surfFishSkin); - LOAD(QString, superPCUname); - LOAD(QString, superPCPasswd); LOAD(Rules, rules); LOAD_SUB(newAbility, Ability); LOAD_SUB(newAuthor, Author); @@ -433,8 +425,6 @@ QDomElement Pokemod::save() const SAVE(QPixmap, flySkin); SAVE(QPixmap, fishSkin); SAVE(QPixmap, surfFishSkin); - SAVE(QString, superPCUname); - SAVE(QString, superPCPasswd); SAVE_Rules(rules); SAVE_MATRIX(Fraction, typeChart); SAVE_SUB(Ability, abilities); @@ -569,16 +559,6 @@ void Pokemod::setSurfFishSkin(const QPixmap& surfFishSkin) emit(changed()); } -void Pokemod::setSuperPCUname(const QString& superPCUname) -{ - CHECK(superPCUname); -} - -void Pokemod::setSuperPCPasswd(const QString& superPCPasswd) -{ - CHECK(superPCPasswd); -} - void Pokemod::setTypeChart(const int attack, const int defense, const Fraction& multiplier) { CHECK_ARRAY(typeChart(attack, defense), multiplier); @@ -649,16 +629,6 @@ QPixmap Pokemod::surfFishSkin() const return m_surfFishSkin; } -QString Pokemod::superPCUname() const -{ - return m_superPCUname; -} - -QString Pokemod::superPCPasswd() const -{ - return m_superPCPasswd; -} - const Matrix<Fraction>* Pokemod::typeChart() const { return &m_typeChart; @@ -2166,8 +2136,6 @@ Pokemod& Pokemod::operator=(const Pokemod& rhs) COPY(description); COPY(startMap); COPY(startWarp); - COPY(superPCUname); - COPY(superPCPasswd); COPY(typeChart); COPY_Rules(rules); COPY_SUB(Ability, abilities); diff --git a/pokemod/Pokemod.h b/pokemod/Pokemod.h index 1509e342..9f4c1d08 100644 --- a/pokemod/Pokemod.h +++ b/pokemod/Pokemod.h @@ -174,8 +174,6 @@ class Pokemod : public Object void setFlySkin(const QPixmap& slySkin); void setFishSkin(const QPixmap& fishSkin); void setSurfFishSkin(const QPixmap& surfFishSkin); - void setSuperPCUname(const QString& superPCUname); - void setSuperPCPasswd(const QString& superPCPasswd); void setTypeChart(const int attack, const int defense, const Fraction& multiplier); void setRules(const Rules& rules); void setRules(const QDomElement& xml); @@ -191,8 +189,6 @@ class Pokemod : public Object QPixmap flySkin() const; QPixmap fishSkin() const; QPixmap surfFishSkin() const; - QString superPCUname() const; - QString superPCPasswd() const; const Matrix<Fraction>* typeChart() const; Matrix<Fraction>* typeChart(); Fraction typeChart(const int attack, const int defense) const; @@ -475,8 +471,6 @@ class Pokemod : public Object void clear(); - void copyDir(const QString& src, const QString& dest) const; - QString m_title; QString m_version; QString m_description; @@ -488,8 +482,6 @@ class Pokemod : public Object QPixmap m_flySkin; QPixmap m_fishSkin; QPixmap m_surfFishSkin; - QString m_superPCUname; - QString m_superPCPasswd; Matrix<Fraction> m_typeChart; Rules* m_rules; QList<Ability*> m_abilities; diff --git a/pokemod/SpeciesEvolution.cpp b/pokemod/SpeciesEvolution.cpp deleted file mode 100644 index 4c2c5c8e..00000000 --- a/pokemod/SpeciesEvolution.cpp +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright 2007-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 "SpeciesEvolution.h" - -// Pokemod includes -#include "Item.h" -#include "Pokemod.h" -#include "Rules.h" -#include "Species.h" - -SpeciesEvolution::SpeciesEvolution(const SpeciesEvolution& evolution) : - Object("SpeciesEvolution", evolution.parent(), evolution.id()) -{ - *this = evolution; -} - -SpeciesEvolution::SpeciesEvolution(const Species* parent, const int id) : - Object("SpeciesEvolution", parent, id), - m_species(INT_MAX), - m_script(""), - m_level(0) -{ -} - -SpeciesEvolution::SpeciesEvolution(const SpeciesEvolution& evolution, const Species* parent, const int id) : - Object("SpeciesEvolution", parent, id) -{ - *this = evolution; -} - -SpeciesEvolution::SpeciesEvolution(const QDomElement& xml, const Species* parent, const int id) : - Object("SpeciesEvolution", parent, id) -{ - load(xml, id); -} - -void SpeciesEvolution::validate() -{ - TEST(setSpecies, species); - if (m_script.isEmpty()) - emit(warning("Script is empty")); - TEST(setLevel, level); -} - -void SpeciesEvolution::load(const QDomElement& xml, int id) -{ - LOAD_ID(); - LOAD(int, species); - LOAD(QString, script); - LOAD(int, level); -} - -QDomElement SpeciesEvolution::save() const -{ - SAVE_CREATE(); - SAVE(int, species); - SAVE(QString, script); - SAVE(int, level); - return xml; -} - -void SpeciesEvolution::setSpecies(const int species) -{ - if (static_cast<const Pokemod*>(pokemod())->speciesIndex(species) == INT_MAX) - { - emit(error(bounds("species"))); - return; - } - CHECK(species); -} - -void SpeciesEvolution::setScript(const QString& script) -{ - CHECK(script); -} - -void SpeciesEvolution::setLevel(const int level) -{ - if (static_cast<const Pokemod*>(pokemod())->rules()->maxLevel() < level) - { - emit(error(bounds("level"))); - return; - } - CHECK(level); -} - -int SpeciesEvolution::species() const -{ - return m_species; -} - -QString SpeciesEvolution::script() const -{ - return m_script; -} - -int SpeciesEvolution::level() const -{ - return m_level; -} - -SpeciesEvolution& SpeciesEvolution::operator=(const SpeciesEvolution& rhs) -{ - if (this == &rhs) - return *this; - COPY(species); - COPY(script); - COPY(level); - return *this; -} diff --git a/pokemod/SpeciesEvolution.h b/pokemod/SpeciesEvolution.h deleted file mode 100644 index 126649b8..00000000 --- a/pokemod/SpeciesEvolution.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2007-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/>. - */ - -#ifndef __POKEMOD_SPECIESEVOLUTION__ -#define __POKEMOD_SPECIESEVOLUTION__ - -// Pokemod includes -#include "Object.h" - -// Forward declarations -class Species; - -class SpeciesEvolution : public Object -{ - Q_OBJECT - - public: - SpeciesEvolution(const SpeciesEvolution& evolution); - SpeciesEvolution(const Species* parent, const int id); - SpeciesEvolution(const SpeciesEvolution& evolution, const Species* parent, const int id); - SpeciesEvolution(const QDomElement& xml, const Species* parent, const int id = INT_MAX); - - void validate(); - - void load(const QDomElement& xml, int id = INT_MAX); - QDomElement save() const; - - void setSpecies(const int species); - void setScript(const QString& script); - void setLevel(const int level); - - int species() const; - QString script() const; - int level() const; - - SpeciesEvolution& operator=(const SpeciesEvolution& rhs); - private: - int m_species; - QString m_script; - int m_level; -}; - -#endif |
