diff options
Diffstat (limited to 'pokescripting')
38 files changed, 3222 insertions, 0 deletions
diff --git a/pokescripting/AbilityWrapper.h b/pokescripting/AbilityWrapper.h new file mode 100644 index 00000000..68c918af --- /dev/null +++ b/pokescripting/AbilityWrapper.h @@ -0,0 +1,67 @@ +/* + * 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/>. + */ + +#ifndef __POKESCRIPTING_ABILITYWRAPPER__ +#define __POKESCRIPTING_ABILITYWRAPPER__ + +// Pokescripting includes +#include "ObjectWrapper.h" + +// Pokemod includes +#include "../pokemod/Ability.h" + +namespace Pokescripting +{ +class POKESCRIPTING_EXPORT AbilityWrapper : public ObjectWrapper +{ + Q_OBJECT + public: + AbilityWrapper(const Pokemod::Ability* ability, QObject* parent); + public slots: + QString name() const; + int priority() const; + QString description() const; + private: + AbilityWrapper& operator=(const AbilityWrapper& rhs); + + const Pokemod::Ability* m_ability; +}; + +inline AbilityWrapper::AbilityWrapper(const Pokemod::Ability* ability, QObject* parent) : + ObjectWrapper(ability, parent), + m_ability(ability) +{ +} + +inline QString AbilityWrapper::name() const +{ + return m_ability->name(); +} + +inline int AbilityWrapper::priority() const +{ + return m_ability->priority(); +} + +inline QString AbilityWrapper::description() const +{ + return m_ability->description(); +} + +} + +#endif diff --git a/pokescripting/AuthorWrapper.h b/pokescripting/AuthorWrapper.h new file mode 100644 index 00000000..6eca1e5b --- /dev/null +++ b/pokescripting/AuthorWrapper.h @@ -0,0 +1,68 @@ +/* + * 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/>. + */ + +#ifndef __POKESCRIPTING_AUTHORWRAPPER__ +#define __POKESCRIPTING_AUTHORWRAPPER__ + +// Pokescripting includes +#include "ObjectWrapper.h" + +// Pokemod includes +#include "../pokemod/Author.h" + +namespace Pokescripting +{ +class POKESCRIPTING_EXPORT AuthorWrapper : public ObjectWrapper +{ + Q_OBJECT + + public: + AuthorWrapper(const Pokemod::Author* author, QObject* parent); + public slots: + QString name() const; + QString email() const; + QString role() const; + private: + AuthorWrapper& operator=(const AuthorWrapper& rhs); + + const Pokemod::Author* m_author; +}; + +inline AuthorWrapper::AuthorWrapper(const Pokemod::Author* author, QObject* parent) : + ObjectWrapper(author, parent), + m_author(author) +{ +} + +inline QString AuthorWrapper::name() const +{ + return m_author->name(); +} + +inline QString AuthorWrapper::email() const +{ + return m_author->email(); +} + +inline QString AuthorWrapper::role() const +{ + return m_author->role(); +} + +} + +#endif diff --git a/pokescripting/BadgeWrapper.h b/pokescripting/BadgeWrapper.h new file mode 100644 index 00000000..bafb1509 --- /dev/null +++ b/pokescripting/BadgeWrapper.h @@ -0,0 +1,80 @@ +/* + * 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/>. + */ + +#ifndef __POKESCRIPTING_BADGEWRAPPER__ +#define __POKESCRIPTING_BADGEWRAPPER__ + +// Pokescripting includes +#include "ObjectWrapper.h" + +// Pokemod includes +#include "../pokemod/Badge.h" + +namespace Pokescripting +{ +class POKESCRIPTING_EXPORT BadgeWrapper : public ObjectWrapper +{ + Q_OBJECT + + public: + BadgeWrapper(const Pokemod::Badge* badge, QObject* parent); + public slots: + QString name() const; + QPixmap face() const; + QPixmap badge() const; + int obey() const; + Pokemod::Fraction stat(const int stat) const; + private: + BadgeWrapper& operator=(const BadgeWrapper& rhs); + + const Pokemod::Badge* m_badge; +}; + +inline BadgeWrapper::BadgeWrapper(const Pokemod::Badge* badge, QObject* parent) : + ObjectWrapper(badge, parent), + m_badge(badge) +{ +} + +inline QString BadgeWrapper::name() const +{ + return m_badge->name(); +} + +inline QPixmap BadgeWrapper::face() const +{ + return m_badge->face(); +} + +inline QPixmap BadgeWrapper::badge() const +{ + return m_badge->badge(); +} + +inline int BadgeWrapper::obey() const +{ + return m_badge->obey(); +} + +inline Pokemod::Fraction BadgeWrapper::stat(const int stat) const +{ + return m_badge->stat(stat); +} + +} + +#endif diff --git a/pokescripting/CMakeLists.txt b/pokescripting/CMakeLists.txt new file mode 100644 index 00000000..4dd5aa47 --- /dev/null +++ b/pokescripting/CMakeLists.txt @@ -0,0 +1,82 @@ +PROJECT(pokescripting) + +IF(NOT BUILT_FROM_ROOT) + MESSAGE(FATAL_ERROR "Not built from source root") +ENDIF(NOT BUILT_FROM_ROOT) + +ADD_DEFINITIONS(-DMAKE_POKESCRIPTING_LIB) + +SET(pokescripting_MOC_HEADERS + Config.h + AbilityWrapper.h + AuthorWrapper.h + BadgeWrapper.h + CoinListWrapper.h + CoinListObjectWrapper.h + EggGroupWrapper.h + GlobalScriptWrapper.h + ItemWrapper.h + ItemTypeWrapper.h + MapWrapper.h + MapEffectWrapper.h + MapTrainerWrapper.h + MapTrainerTeamMemberWrapper.h + MapWarpWrapper.h + MapWildListWrapper.h + MapWildListEncounterWrapper.h + MoveWrapper.h + NatureWrapper.h + ObjectWrapper.h + PokemodWrapper.h + RulesWrapper.h + SoundWrapper.h + SpeciesWrapper.h + SpeciesAbilityWrapper.h + SpeciesItemWrapper.h + SpeciesMoveWrapper.h + SpriteWrapper.h + StatusWrapper.h + StoreWrapper.h + TileWrapper.h + TimeWrapper.h + TrainerWrapper.h + TypeWrapper.h + WeatherWrapper.h +) +QT4_WRAP_CPP(pokescripting_MOC_SRCS ${pokescripting_MOC_HEADERS}) +SET(pokescripting_HEADERS +) +SET(pokescripting_DEVEL + ${pokescripting_HEADERS} + ${pokescripting_MOC_HEADERS} +) +SET(pokescripting_SRCS + Config.cpp +) + +ADD_LIBRARY(pokescripting + ${pokescripting_SRCS} + ${pokescripting_MOC_SRCS} +) +SET_TARGET_PROPERTIES(pokescripting + PROPERTIES + VERSION ${POKEGEN_VERSION} + SOVERSION ${POKEGEN_SOVERSION} +) +TARGET_LINK_LIBRARIES(pokescripting + ${QT_QTCORE_LIBRARY} + ${KDE4_KROSSCORE_LIBS} + pokemod +) + +INSTALL( + TARGETS pokescripting + DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX} + COMPONENT runtime +) + +INSTALL( + FILES ${pokescripting_DEVEL} + DESTINATION ${CMAKE_INSTALL_PREFIX}/include/${CMAKE_PROJECT_NAME}/${PROJECT_NAME} + COMPONENT development +) diff --git a/pokescripting/CoinListObjectWrapper.h b/pokescripting/CoinListObjectWrapper.h new file mode 100644 index 00000000..6fb71cea --- /dev/null +++ b/pokescripting/CoinListObjectWrapper.h @@ -0,0 +1,86 @@ +/* + * 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/>. + */ + +#ifndef __POKESCRIPTING_COINLISTOBJECTWRAPPER__ +#define __POKESCRIPTING_COINLISTOBJECTWRAPPER__ + +// Pokescripting includes +#include "ItemWrapper.h" +#include "ObjectWrapper.h" +#include "SpeciesWrapper.h" + +// Pokemod includes +#include "../pokemod/CoinListObject.h" + +namespace Pokescripting +{ +class POKESCRIPTING_EXPORT CoinListObjectWrapper : public ObjectWrapper +{ + Q_OBJECT + + public: + CoinListObjectWrapper(const Pokemod::CoinListObject* object, QObject* parent); + public slots: + int type() const; + const ItemWrapper* itemObject() const; + const SpeciesWrapper* speciesObject() const; + int amount() const; + int cost() const; + private: + CoinListObjectWrapper& operator=(const CoinListObjectWrapper& rhs); + + const Pokemod::CoinListObject* m_object; +}; + +inline CoinListObjectWrapper::CoinListObjectWrapper(const Pokemod::CoinListObject* object, QObject* parent) : + ObjectWrapper(object, parent), + m_object(object) +{ +} + +inline int CoinListObjectWrapper::type() const +{ + return m_object->type(); +} + +inline const ItemWrapper* CoinListObjectWrapper::itemObject() const +{ + if (m_object->type() == Pokemod::CoinListObject::Item) + return new ItemWrapper(pokemod()->itemById(m_object->object()), const_cast<CoinListObjectWrapper*>(this)); + return NULL; +} + +inline const SpeciesWrapper* CoinListObjectWrapper::speciesObject() const +{ + if (m_object->type() == Pokemod::CoinListObject::Species) + return new SpeciesWrapper(pokemod()->speciesById(m_object->object()), const_cast<CoinListObjectWrapper*>(this)); + return NULL; +} + +inline int CoinListObjectWrapper::amount() const +{ + return m_object->amount(); +} + +inline int CoinListObjectWrapper::cost() const +{ + return m_object->cost(); +} + +} + +#endif diff --git a/pokescripting/CoinListWrapper.h b/pokescripting/CoinListWrapper.h new file mode 100644 index 00000000..21b902b2 --- /dev/null +++ b/pokescripting/CoinListWrapper.h @@ -0,0 +1,70 @@ +/* + * 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/>. + */ + +#ifndef __POKESCRIPTING_COINLISTWRAPPER__ +#define __POKESCRIPTING_COINLISTWRAPPER__ + +// Pokescripting includes +#include "CoinListObjectWrapper.h" +#include "ObjectWrapper.h" + +// Pokemod includes +#include "../pokemod/CoinList.h" + +namespace Pokescripting +{ +class POKESCRIPTING_EXPORT CoinListWrapper : public ObjectWrapper +{ + Q_OBJECT + + public: + CoinListWrapper(const Pokemod::CoinList* coinList, QObject* parent); + public slots: + QString name() const; + + const CoinListObjectWrapper* object(const int index) const; + int objectCount() const; + private: + CoinListWrapper& operator=(const CoinListWrapper& rhs); + + const Pokemod::CoinList* m_coinList; +}; + +inline CoinListWrapper::CoinListWrapper(const Pokemod::CoinList* coinList, QObject* parent) : + ObjectWrapper(coinList, parent), + m_coinList(coinList) +{ +} + +inline QString CoinListWrapper::name() const +{ + return m_coinList->name(); +} + +inline const CoinListObjectWrapper* CoinListWrapper::object(const int index) const +{ + return new CoinListObjectWrapper(m_coinList->object(index), const_cast<CoinListWrapper*>(this)); +} + +inline int CoinListWrapper::objectCount() const +{ + return m_coinList->objectCount(); +} + +} + +#endif diff --git a/pokescripting/Config.cpp b/pokescripting/Config.cpp new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/pokescripting/Config.cpp diff --git a/pokescripting/Config.h b/pokescripting/Config.h new file mode 100644 index 00000000..4a186f96 --- /dev/null +++ b/pokescripting/Config.h @@ -0,0 +1,44 @@ +/* + * 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/>. + */ + +#ifndef __POKESCRIPTING_CONFIG__ +#define __POKESCRIPTING_CONFIG__ + +// Qt includes +#include <QMap> +#include <QObject> +#include <QString> +#include <QVariant> + +// Forward declarations +namespace Pokemod +{ +class Pokemod; +} + +namespace Pokescripting +{ +class Config : public QObject +{ + Q_OBJECT + + public: + private: +}; +} + +#endif diff --git a/pokescripting/EggGroupWrapper.h b/pokescripting/EggGroupWrapper.h new file mode 100644 index 00000000..d8d33683 --- /dev/null +++ b/pokescripting/EggGroupWrapper.h @@ -0,0 +1,56 @@ +/* + * 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/>. + */ + +#ifndef __POKESCRIPTING_EGGGROUPWRAPPER__ +#define __POKESCRIPTING_EGGGROUPWRAPPER__ + +// Pokescripting includes +#include "ObjectWrapper.h" + +// Pokemod includes +#include "../pokemod/EggGroup.h" + +namespace Pokescripting +{ +class POKESCRIPTING_EXPORT EggGroupWrapper : public ObjectWrapper +{ + Q_OBJECT + + public: + EggGroupWrapper(const Pokemod::EggGroup* eggGroup, QObject* parent); + public slots: + QString name() const; + private: + EggGroupWrapper& operator=(const EggGroupWrapper& rhs); + + const Pokemod::EggGroup* m_eggGroup; +}; + +inline EggGroupWrapper::EggGroupWrapper(const Pokemod::EggGroup* eggGroup, QObject* parent) : + ObjectWrapper(eggGroup, parent), + m_eggGroup(eggGroup) +{ +} + +inline QString EggGroupWrapper::name() const +{ + return m_eggGroup->name(); +} + +} + +#endif diff --git a/pokescripting/Global.h b/pokescripting/Global.h new file mode 100644 index 00000000..d77ef326 --- /dev/null +++ b/pokescripting/Global.h @@ -0,0 +1,38 @@ +/* + * 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/>. + */ + +#ifndef __POKESCRIPTING_GLOBAL__ +#define __POKESCRIPTING_GLOBAL__ + +// KDE includes +#include <kdemacros.h> + +#ifndef POKESCRIPTING_EXPORT +# ifdef MAKE_POKESCRIPTING_LIB + /* We are building this library */ +# define POKESCRIPTING_EXPORT KDE_EXPORT +# else + /* We are using this library */ +# define POKESCRIPTING_EXPORT KDE_IMPORT +# endif +#endif + +# ifndef POKESCRIPTING_EXPORT_DEPRECATED +# define POKESCRIPTING_EXPORT_DEPRECATED KDE_DEPRECATED POKESCRIPTING_EXPORT +# endif + +#endif diff --git a/pokescripting/GlobalScriptWrapper.h b/pokescripting/GlobalScriptWrapper.h new file mode 100644 index 00000000..cfd42065 --- /dev/null +++ b/pokescripting/GlobalScriptWrapper.h @@ -0,0 +1,56 @@ +/* + * 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/>. + */ + +#ifndef __POKESCRIPTING_GLOBALSCRIPTWRAPPER__ +#define __POKESCRIPTING_GLOBALSCRIPTWRAPPER__ + +// Pokescripting includes +#include "ObjectWrapper.h" + +// Pokemod includes +#include "../pokemod/GlobalScript.h" + +namespace Pokescripting +{ +class POKESCRIPTING_EXPORT GlobalScriptWrapper : public ObjectWrapper +{ + Q_OBJECT + + public: + GlobalScriptWrapper(const Pokemod::GlobalScript* globalScript, QObject* parent); + public slots: + QString name() const; + private: + GlobalScriptWrapper& operator=(const GlobalScriptWrapper& rhs); + + const Pokemod::GlobalScript* m_globalScript; +}; + +inline GlobalScriptWrapper::GlobalScriptWrapper(const Pokemod::GlobalScript* globalScript, QObject* parent) : + ObjectWrapper(globalScript, parent), + m_globalScript(globalScript) +{ +} + +inline QString GlobalScriptWrapper::name() const +{ + return m_globalScript->name(); +} + +} + +#endif diff --git a/pokescripting/ItemTypeWrapper.h b/pokescripting/ItemTypeWrapper.h new file mode 100644 index 00000000..4092d800 --- /dev/null +++ b/pokescripting/ItemTypeWrapper.h @@ -0,0 +1,74 @@ +/* + * 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/>. + */ + +#ifndef __POKESCRIPTING_ITEMTYPEWRAPPER__ +#define __POKESCRIPTING_ITEMTYPEWRAPPER__ + +// Pokescripting includes +#include "ObjectWrapper.h" + +// Pokemod includes +#include "../pokemod/ItemType.h" + +namespace Pokescripting +{ +class POKESCRIPTING_EXPORT ItemTypeWrapper : public ObjectWrapper +{ + Q_OBJECT + + public: + ItemTypeWrapper(const Pokemod::ItemType* itemType, QObject* parent); + public slots: + QString name() const; + int computer() const; + int player() const; + int count() const; + private: + ItemTypeWrapper& operator=(const ItemTypeWrapper& rhs); + + const Pokemod::ItemType* m_itemType; +}; + +inline ItemTypeWrapper::ItemTypeWrapper(const Pokemod::ItemType* itemType, QObject* parent) : + ObjectWrapper(itemType, parent), + m_itemType(itemType) +{ +} + +inline QString ItemTypeWrapper::name() const +{ + return m_itemType->name(); +} + +inline int ItemTypeWrapper::computer() const +{ + return m_itemType->computer(); +} + +inline int ItemTypeWrapper::player() const +{ + return m_itemType->player(); +} + +inline int ItemTypeWrapper::count() const +{ + return m_itemType->count(); +} + +} + +#endif diff --git a/pokescripting/ItemWrapper.h b/pokescripting/ItemWrapper.h new file mode 100644 index 00000000..784cd63c --- /dev/null +++ b/pokescripting/ItemWrapper.h @@ -0,0 +1,81 @@ +/* + * 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/>. + */ + +#ifndef __POKESCRIPTING_ITEMWRAPPER__ +#define __POKESCRIPTING_ITEMWRAPPER__ + +// Pokescripting includes +#include "ItemTypeWrapper.h" +#include "ObjectWrapper.h" + +// Pokemod includes +#include "../pokemod/Item.h" + +namespace Pokescripting +{ +class POKESCRIPTING_EXPORT ItemWrapper : public ObjectWrapper +{ + Q_OBJECT + + public: + ItemWrapper(const Pokemod::Item* item, QObject* parent); + public slots: + QString name() const; + bool sellable() const; + const ItemTypeWrapper* type() const; + int price() const; + QString description() const; + private: + ItemWrapper& operator=(const ItemWrapper& rhs); + + const Pokemod::Item* m_item; +}; + +inline ItemWrapper::ItemWrapper(const Pokemod::Item* item, QObject* parent) : + ObjectWrapper(item, parent), + m_item(item) +{ +} + +inline QString ItemWrapper::name() const +{ + return m_item->name(); +} + +inline bool ItemWrapper::sellable() const +{ + return m_item->sellable(); +} + +inline const ItemTypeWrapper* ItemWrapper::type() const +{ + return new ItemTypeWrapper(pokemod()->itemTypeById(m_item->type()), const_cast<ItemWrapper*>(this)); +} + +inline int ItemWrapper::price() const +{ + return m_item->price(); +} + +inline QString ItemWrapper::description() const +{ + return m_item->description(); +} + +} + +#endif diff --git a/pokescripting/MapEffectWrapper.h b/pokescripting/MapEffectWrapper.h new file mode 100644 index 00000000..161838e2 --- /dev/null +++ b/pokescripting/MapEffectWrapper.h @@ -0,0 +1,68 @@ +/* + * 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/>. + */ + +#ifndef __POKESCRIPTING_MAPEFFECTWRAPPER__ +#define __POKESCRIPTING_MAPEFFECTWRAPPER__ + +// Pokescripting includes +#include "ObjectWrapper.h" + +// Pokemod includes +#include "../pokemod/MapEffect.h" + +namespace Pokescripting +{ +class POKESCRIPTING_EXPORT MapEffectWrapper : public ObjectWrapper +{ + Q_OBJECT + + public: + MapEffectWrapper(const Pokemod::MapEffect* effect, QObject* parent); + public slots: + QString name() const; + QPixmap skin() const; + bool isGhost() const; + private: + MapEffectWrapper& operator=(const MapEffectWrapper& rhs); + + const Pokemod::MapEffect* m_effect; +}; + +inline MapEffectWrapper::MapEffectWrapper(const Pokemod::MapEffect* effect, QObject* parent) : + ObjectWrapper(effect, parent), + m_effect(effect) +{ +} + +inline QString MapEffectWrapper::name() const +{ + return m_effect->name(); +} + +inline QPixmap MapEffectWrapper::skin() const +{ + return m_effect->skin(); +} + +inline bool MapEffectWrapper::isGhost() const +{ + return m_effect->isGhost(); +} + +} + +#endif diff --git a/pokescripting/MapTrainerTeamMemberWrapper.h b/pokescripting/MapTrainerTeamMemberWrapper.h new file mode 100644 index 00000000..b8495745 --- /dev/null +++ b/pokescripting/MapTrainerTeamMemberWrapper.h @@ -0,0 +1,91 @@ +/* + * 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/>. + */ + +#ifndef __POKESCRIPTING_MAPTRAINERTEAMMEMBERWRAPPER__ +#define __POKESCRIPTING_MAPTRAINERTEAMMEMBERWRAPPER__ + +// Pokescripting includes +#include "AbilityWrapper.h" +#include "ItemWrapper.h" +#include "MoveWrapper.h" +#include "NatureWrapper.h" +#include "ObjectWrapper.h" +#include "SpeciesWrapper.h" + +// Pokemod includes +#include "../pokemod/MapTrainerTeamMember.h" + +namespace Pokescripting +{ +class POKESCRIPTING_EXPORT MapTrainerTeamMemberWrapper : public ObjectWrapper +{ + Q_OBJECT + + public: + MapTrainerTeamMemberWrapper(const Pokemod::MapTrainerTeamMember* teamMember, QObject* parent); + public slots: + const SpeciesWrapper* species() const; + int level() const; + bool ability(const int ability) const; + bool item(const int item) const; + bool move(const int move) const; + bool nature(const int nature) const; + private: + MapTrainerTeamMemberWrapper& operator=(const MapTrainerTeamMemberWrapper& rhs); + + const Pokemod::MapTrainerTeamMember* m_teamMember; +}; + +inline MapTrainerTeamMemberWrapper::MapTrainerTeamMemberWrapper(const Pokemod::MapTrainerTeamMember* teamMember, QObject* parent) : + ObjectWrapper(teamMember, parent), + m_teamMember(teamMember) +{ +} + +inline const SpeciesWrapper* MapTrainerTeamMemberWrapper::species() const +{ + return new SpeciesWrapper(pokemod()->speciesById(m_teamMember->species()), const_cast<MapTrainerTeamMemberWrapper*>(this)); +} + +inline int MapTrainerTeamMemberWrapper::level() const +{ + return m_teamMember->level(); +} + +inline bool MapTrainerTeamMemberWrapper::ability(const int ability) const +{ + return m_teamMember->ability(ability); +} + +inline bool MapTrainerTeamMemberWrapper::item(const int item) const +{ + return m_teamMember->item(item); +} + +inline bool MapTrainerTeamMemberWrapper::move(const int move) const +{ + return m_teamMember->move(move); +} + +inline bool MapTrainerTeamMemberWrapper::nature(const int nature) const +{ + return m_teamMember->nature(nature); +} + +} + +#endif diff --git a/pokescripting/MapTrainerWrapper.h b/pokescripting/MapTrainerWrapper.h new file mode 100644 index 00000000..c6554d55 --- /dev/null +++ b/pokescripting/MapTrainerWrapper.h @@ -0,0 +1,89 @@ +/* + * 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/>. + */ + +#ifndef __POKESCRIPTING_MAPTRAINERWRAPPER__ +#define __POKESCRIPTING_MAPTRAINERWRAPPER__ + +// Pokescripting includes +#include "MapTrainerTeamMemberWrapper.h" +#include "ObjectWrapper.h" +#include "TrainerWrapper.h" + +// Pokemod includes +#include "../pokemod/MapTrainer.h" + +namespace Pokescripting +{ +class POKESCRIPTING_EXPORT MapTrainerWrapper : public ObjectWrapper +{ + Q_OBJECT + + public: + MapTrainerWrapper(const Pokemod::MapTrainer* trainer, QObject* parent); + public slots: + QString name() const; + const TrainerWrapper* trainerClass() const; + int numberFight() const; + const MapTrainerTeamMemberWrapper* leadTeamMember() const; + + const MapTrainerTeamMemberWrapper* teamMember(const int index) const; + int teamMemberCount() const; + private: + MapTrainerWrapper& operator=(const MapTrainerWrapper& rhs); + + const Pokemod::MapTrainer* m_trainer; +}; + +inline MapTrainerWrapper::MapTrainerWrapper(const Pokemod::MapTrainer* trainer, QObject* parent) : + ObjectWrapper(trainer, parent), + m_trainer(trainer) +{ +} + +inline QString MapTrainerWrapper::name() const +{ + return m_trainer->name(); +} + +inline const TrainerWrapper* MapTrainerWrapper::trainerClass() const +{ + return new TrainerWrapper(pokemod()->trainerById(m_trainer->trainerClass()), const_cast<MapTrainerWrapper*>(this)); +} + +inline int MapTrainerWrapper::numberFight() const +{ + return m_trainer->numberFight(); +} + +inline const MapTrainerTeamMemberWrapper* MapTrainerWrapper::leadTeamMember() const +{ + return teamMember(m_trainer->leadTeamMember()); +} + +inline const MapTrainerTeamMemberWrapper* MapTrainerWrapper::teamMember(const int index) const +{ + return new MapTrainerTeamMemberWrapper(m_trainer->teamMember(index), const_cast<MapTrainerWrapper*>(this)); +} + +inline int MapTrainerWrapper::teamMemberCount() const +{ + return m_trainer->teamMemberCount(); +} + +} + +#endif diff --git a/pokescripting/MapWarpWrapper.h b/pokescripting/MapWarpWrapper.h new file mode 100644 index 00000000..5d1dd8ec --- /dev/null +++ b/pokescripting/MapWarpWrapper.h @@ -0,0 +1,75 @@ +/* + * 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/>. + */ + +#ifndef __POKESCRIPTING_MAPWARPWRAPPER__ +#define __POKESCRIPTING_MAPWARPWRAPPER__ + +// Pokescripting includes +#include "ObjectWrapper.h" + +// Pokemod includes +#include "../pokemod/Map.h" +#include "../pokemod/MapWarp.h" + +namespace Pokescripting +{ +class POKESCRIPTING_EXPORT MapWarpWrapper : public ObjectWrapper +{ + Q_OBJECT + + public: + MapWarpWrapper(const Pokemod::MapWarp* warp, QObject* parent); + public slots: + QString name() const; + QPoint coordinate() const; + int type() const; + const MapWarpWrapper* toWarp() const; + private: + MapWarpWrapper& operator=(const MapWarpWrapper& rhs); + + const Pokemod::MapWarp* m_warp; +}; + +inline MapWarpWrapper::MapWarpWrapper(const Pokemod::MapWarp* warp, QObject* parent) : + ObjectWrapper(warp, parent), + m_warp(warp) +{ +} + +inline QString MapWarpWrapper::name() const +{ + return m_warp->name(); +} + +inline QPoint MapWarpWrapper::coordinate() const +{ + return m_warp->coordinate(); +} + +inline int MapWarpWrapper::type() const +{ + return m_warp->type(); +} + +inline const MapWarpWrapper* MapWarpWrapper::toWarp() const +{ + return new MapWarpWrapper(pokemod()->mapById(m_warp->toMap())->warpById(m_warp->toWarp()), const_cast<MapWarpWrapper*>(this)); +} + +} + +#endif diff --git a/pokescripting/MapWildListEncounterWrapper.h b/pokescripting/MapWildListEncounterWrapper.h new file mode 100644 index 00000000..2fcb357a --- /dev/null +++ b/pokescripting/MapWildListEncounterWrapper.h @@ -0,0 +1,69 @@ +/* + * 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/>. + */ + +#ifndef __POKESCRIPTING_MAPWILDLISTENCOUNTERWRAPPER__ +#define __POKESCRIPTING_MAPWILDLISTENCOUNTERWRAPPER__ + +// Pokescripting includes +#include "ObjectWrapper.h" +#include "SpeciesWrapper.h" + +// Pokemod includes +#include "../pokemod/MapWildListEncounter.h" + +namespace Pokescripting +{ +class POKESCRIPTING_EXPORT MapWildListEncounterWrapper : public ObjectWrapper +{ + Q_OBJECT + + public: + MapWildListEncounterWrapper(const Pokemod::MapWildListEncounter* encounter, QObject* parent); + public slots: + const SpeciesWrapper* species() const; + int level() const; + int weight() const; + private: + MapWildListEncounterWrapper& operator=(const MapWildListEncounterWrapper& rhs); + + const Pokemod::MapWildListEncounter* m_encounter; +}; + +inline MapWildListEncounterWrapper::MapWildListEncounterWrapper(const Pokemod::MapWildListEncounter* encounter, QObject* parent) : + ObjectWrapper(encounter, parent), + m_encounter(encounter) +{ +} + +inline const SpeciesWrapper* MapWildListEncounterWrapper::species() const +{ + return new SpeciesWrapper(pokemod()->speciesById(m_encounter->species()), const_cast<MapWildListEncounterWrapper*>(this)); +} + +inline int MapWildListEncounterWrapper::level() const +{ + return m_encounter->level(); +} + +inline int MapWildListEncounterWrapper::weight() const +{ + return m_encounter->weight(); +} + +} + +#endif diff --git a/pokescripting/MapWildListWrapper.h b/pokescripting/MapWildListWrapper.h new file mode 100644 index 00000000..cf37a07a --- /dev/null +++ b/pokescripting/MapWildListWrapper.h @@ -0,0 +1,70 @@ +/* + * 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/>. + */ + +#ifndef __POKESCRIPTING_MAPWILDLISTWRAPPER__ +#define __POKESCRIPTING_MAPWILDLISTWRAPPER__ + +// Pokescripting includes +#include "MapWildListEncounterWrapper.h" +#include "ObjectWrapper.h" + +// Pokemod includes +#include "../pokemod/MapWildList.h" + +namespace Pokescripting +{ +class POKESCRIPTING_EXPORT MapWildListWrapper : public ObjectWrapper +{ + Q_OBJECT + + public: + MapWildListWrapper(const Pokemod::MapWildList* wildList, QObject* parent); + public slots: + QString name() const; + + const MapWildListEncounterWrapper* encounter(const int index) const; + int encounterCount() const; + private: + MapWildListWrapper& operator=(const MapWildListWrapper& rhs); + + const Pokemod::MapWildList* m_wildList; +}; + +inline MapWildListWrapper::MapWildListWrapper(const Pokemod::MapWildList* wildList, QObject* parent) : + ObjectWrapper(wildList, parent), + m_wildList(wildList) +{ +} + +inline QString MapWildListWrapper::name() const +{ + return m_wildList->name(); +} + +inline const MapWildListEncounterWrapper* MapWildListWrapper::encounter(const int index) const +{ + return new MapWildListEncounterWrapper(m_wildList->encounter(index), const_cast<MapWildListWrapper*>(this)); +} + +inline int MapWildListWrapper::encounterCount() const +{ + return m_wildList->encounterCount(); +} + +} + +#endif diff --git a/pokescripting/MapWrapper.h b/pokescripting/MapWrapper.h new file mode 100644 index 00000000..7221b1cc --- /dev/null +++ b/pokescripting/MapWrapper.h @@ -0,0 +1,130 @@ +/* + * 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/>. + */ + +#ifndef __POKESCRIPTING_MAPWRAPPER__ +#define __POKESCRIPTING_MAPWRAPPER__ + +// Pokescripting includes +#include "MapEffectWrapper.h" +#include "MapTrainerWrapper.h" +#include "MapWarpWrapper.h" +#include "MapWildListWrapper.h" +#include "ObjectWrapper.h" +#include "TileWrapper.h" + +// Pokemod includes +#include "../pokemod/Map.h" + +namespace Pokescripting +{ +class POKESCRIPTING_EXPORT MapWrapper : public ObjectWrapper +{ + Q_OBJECT + + public: + MapWrapper(const Pokemod::Map* map, QObject* parent); + public slots: + QString name() const; + const MapWarpWrapper* flyWarp() const; + int type() const; + const TileWrapper* tile(const int row, const int column) const; + QPoint mapSize() const; + + const MapEffectWrapper* effect(const QString& name) const; + const MapTrainerWrapper* trainer(const QString& name) const; + const MapWarpWrapper* warp(const QString& name) const; + const MapWildListWrapper* wildList(const QString& name) const; + private: + MapWrapper& operator=(const MapWrapper& rhs); + + const Pokemod::Map* m_map; +}; + +inline MapWrapper::MapWrapper(const Pokemod::Map* map, QObject* parent) : + ObjectWrapper(map, parent), + m_map(map) +{ +} + +inline QString MapWrapper::name() const +{ + return m_map->name(); +} + +inline const MapWarpWrapper* MapWrapper::flyWarp() const +{ + return new MapWarpWrapper(m_map->warpById(m_map->flyWarp()), const_cast<MapWrapper*>(this)); +} + +inline int MapWrapper::type() const +{ + return m_map->type(); +} + +inline const TileWrapper* MapWrapper::tile(const int row, const int column) const +{ + return new TileWrapper(pokemod()->tileById(m_map->tile(row, column)), const_cast<MapWrapper*>(this)); +} + +inline QPoint MapWrapper::mapSize() const +{ + return m_map->size(); +} + +inline const MapEffectWrapper* MapWrapper::effect(const QString& name) const +{ + for (int i = 0; i < m_map->effectCount(); ++i) + { + if (m_map->effect(i)->name() == name) + return new MapEffectWrapper(m_map->effect(i), const_cast<MapWrapper*>(this)); + } + return NULL; +} + +inline const MapTrainerWrapper* MapWrapper::trainer(const QString& name) const +{ + for (int i = 0; i < m_map->trainerCount(); ++i) + { + if (m_map->trainer(i)->name() == name) + return new MapTrainerWrapper(m_map->trainer(i), const_cast<MapWrapper*>(this)); + } + return NULL; +} + +inline const MapWarpWrapper* MapWrapper::warp(const QString& name) const +{ + for (int i = 0; i < m_map->warpCount(); ++i) + { + if (m_map->warp(i)->name() == name) + return new MapWarpWrapper(m_map->warp(i), const_cast<MapWrapper*>(this)); + } + return NULL; +} + +inline const MapWildListWrapper* MapWrapper::wildList(const QString& name) const +{ + for (int i = 0; i < m_map->wildListCount(); ++i) + { + if (m_map->wildList(i)->name() == name) + return new MapWildListWrapper(m_map->wildList(i), const_cast<MapWrapper*>(this)); + } + return NULL; +} + +} + +#endif diff --git a/pokescripting/MoveWrapper.h b/pokescripting/MoveWrapper.h new file mode 100644 index 00000000..eab6d53f --- /dev/null +++ b/pokescripting/MoveWrapper.h @@ -0,0 +1,105 @@ +/* + * 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/>. + */ + +#ifndef __POKESCRIPTING_MOVEWRAPPER__ +#define __POKESCRIPTING_MOVEWRAPPER__ + +// Pokescripting includes +#include "ObjectWrapper.h" +#include "TypeWrapper.h" + +// Pokemod includes +#include "../pokemod/Move.h" + +namespace Pokescripting +{ +class POKESCRIPTING_EXPORT MoveWrapper : public ObjectWrapper +{ + Q_OBJECT + + public: + MoveWrapper(const Pokemod::Move* move, QObject* parent); + public slots: + QString name() const; + Pokemod::Fraction accuracy() const; + int power() const; + const TypeWrapper* type() const; + bool special() const; + bool overworld() const; + int powerPoints() const; + int priority() const; + QString description() const; + private: + MoveWrapper& operator=(const MoveWrapper& rhs); + + const Pokemod::Move* m_move; +}; + +inline MoveWrapper::MoveWrapper(const Pokemod::Move* move, QObject* parent) : + ObjectWrapper(move, parent), + m_move(move) +{ +} + +inline QString MoveWrapper::name() const +{ + return m_move->name(); +} + +inline Pokemod::Fraction MoveWrapper::accuracy() const +{ + return m_move->accuracy(); +} + +inline int MoveWrapper::power() const +{ + return m_move->power(); +} + +inline const TypeWrapper* MoveWrapper::type() const +{ + return new TypeWrapper(pokemod()->typeById(m_move->type()), const_cast<MoveWrapper*>(this)); +} + +inline bool MoveWrapper::special() const +{ + return m_move->special(); +} + +inline bool MoveWrapper::overworld() const +{ + return m_move->overworld(); +} + +inline int MoveWrapper::powerPoints() const +{ + return m_move->powerPoints(); +} + +inline int MoveWrapper::priority() const +{ + return m_move->priority(); +} + +inline QString MoveWrapper::description() const +{ + return m_move->description(); +} + +} + +#endif diff --git a/pokescripting/NatureWrapper.h b/pokescripting/NatureWrapper.h new file mode 100644 index 00000000..776716cf --- /dev/null +++ b/pokescripting/NatureWrapper.h @@ -0,0 +1,68 @@ +/* + * 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/>. + */ + +#ifndef __POKESCRIPTING_NATUREWRAPPER__ +#define __POKESCRIPTING_NATUREWRAPPER__ + +// Pokescripting includes +#include "ObjectWrapper.h" + +// Pokemod includes +#include "../pokemod/Nature.h" + +namespace Pokescripting +{ +class POKESCRIPTING_EXPORT NatureWrapper : public ObjectWrapper +{ + Q_OBJECT + + public: + NatureWrapper(const Pokemod::Nature* nature, QObject* parent); + public slots: + QString name() const; + Pokemod::Fraction stat(const int stat) const; + int weight() const; + private: + NatureWrapper& operator=(const NatureWrapper& rhs); + + const Pokemod::Nature* m_nature; +}; + +inline NatureWrapper::NatureWrapper(const Pokemod::Nature* nature, QObject* parent) : + ObjectWrapper(nature, parent), + m_nature(nature) +{ +} + +inline QString NatureWrapper::name() const +{ + return m_nature->name(); +} + +inline Pokemod::Fraction NatureWrapper::stat(const int stat) const +{ + return m_nature->stat(stat); +} + +inline int NatureWrapper::weight() const +{ + return m_nature->weight(); +} + +} + +#endif diff --git a/pokescripting/ObjectWrapper.h b/pokescripting/ObjectWrapper.h new file mode 100644 index 00000000..5c26f6dc --- /dev/null +++ b/pokescripting/ObjectWrapper.h @@ -0,0 +1,65 @@ +/* + * 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/>. + */ + +#ifndef __POKESCRIPTING_OBJECTWRAPPER__ +#define __POKESCRIPTING_OBJECTWRAPPER__ + +// Pokescripting includes +#include "Global.h" + +// Pokemod includes +#include "../pokemod/Object.h" +#include "../pokemod/Pokemod.h" + +// Qt includes +#include <QtCore/QObject> + +namespace Pokescripting +{ +class POKESCRIPTING_EXPORT ObjectWrapper : public QObject +{ + Q_OBJECT + Q_PROPERTY(int id READ id) + + public: + ObjectWrapper(const Pokemod::Object* object, QObject* parent); + + int id() const; + const Pokemod::Pokemod* pokemod() const; + private: + const Pokemod::Object* m_object; +}; + +inline ObjectWrapper::ObjectWrapper(const Pokemod::Object* object, QObject* parent) : + QObject(parent), + m_object(object) +{ +} + +inline int ObjectWrapper::id() const +{ + return m_object->id(); +} + +inline const Pokemod::Pokemod* ObjectWrapper::pokemod() const +{ + return qobject_cast<const Pokemod::Pokemod*>(m_object->pokemod()); +} + +} + +#endif diff --git a/pokescripting/PokemodWrapper.h b/pokescripting/PokemodWrapper.h new file mode 100644 index 00000000..42bb1878 --- /dev/null +++ b/pokescripting/PokemodWrapper.h @@ -0,0 +1,376 @@ +/* + * 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/>. + */ + +#ifndef __POKESCRIPTING_POKEMODWRAPPER__ +#define __POKESCRIPTING_POKEMODWRAPPER__ + +// Pokescripting includes +#include "AbilityWrapper.h" +#include "AuthorWrapper.h" +#include "BadgeWrapper.h" +#include "CoinListWrapper.h" +#include "EggGroupWrapper.h" +#include "GlobalScriptWrapper.h" +#include "ItemWrapper.h" +#include "ItemTypeWrapper.h" +#include "MapWrapper.h" +#include "MoveWrapper.h" +#include "NatureWrapper.h" +#include "ObjectWrapper.h" +#include "RulesWrapper.h" +#include "SoundWrapper.h" +#include "SpeciesWrapper.h" +#include "SpriteWrapper.h" +#include "StatusWrapper.h" +#include "StoreWrapper.h" +#include "TileWrapper.h" +#include "TimeWrapper.h" +#include "TrainerWrapper.h" +#include "TypeWrapper.h" +#include "WeatherWrapper.h" + +// Pokemod includes +#include "../pokemod/Pokemod.h" + +namespace Pokescripting +{ +class POKESCRIPTING_EXPORT PokemodWrapper : public ObjectWrapper +{ + Q_OBJECT + + public: + PokemodWrapper(const Pokemod::Pokemod* pokemod, QObject* parent); + public slots: + QString title() const; + QString version() const; + QString description() const; + const MapWarpWrapper* startWarp() const; + QPixmap walkSkin() const; + QPixmap bikeSkin() const; + QPixmap surfSkin() const; + QPixmap flySkin() const; + QPixmap fishSkin() const; + QPixmap surfFishSkin() const; + Pokemod::Fraction effectiveness(const TypeWrapper* attacker, const TypeWrapper* defender) const; + const RulesWrapper* rules() const; + + const AbilityWrapper* ability(const QString& name) const; + const AuthorWrapper* author(const QString& name) const; + const BadgeWrapper* badge(const QString& name) const; + const CoinListWrapper* coinList(const QString& name) const; + const EggGroupWrapper* eggGroup(const QString& name) const; + const GlobalScriptWrapper* globalScript(const QString& name) const; + const ItemWrapper* item(const QString& name) const; + const ItemTypeWrapper* itemType(const QString& name) const; + const MapWrapper* map(const QString& name) const; + const MoveWrapper* move(const QString& name) const; + const NatureWrapper* nature(const QString& name) const; + const SoundWrapper* sound(const QString& name) const; + const SpeciesWrapper* species(const QString& name) const; + const SpriteWrapper* sprite(const QString& name) const; + const StatusWrapper* status(const QString& name) const; + const StoreWrapper* store(const QString& name) const; + const TileWrapper* tile(const QString& name) const; + const TimeWrapper* time(const QString& name) const; + const TrainerWrapper* trainer(const QString& name) const; + const TypeWrapper* type(const QString& name) const; + const WeatherWrapper* weather(const QString& name) const; + private: + PokemodWrapper& operator=(const PokemodWrapper& rhs); + + const Pokemod::Pokemod* m_pokemod; +}; + +inline PokemodWrapper::PokemodWrapper(const Pokemod::Pokemod* pokemod, QObject* parent) : + ObjectWrapper(pokemod, parent), + m_pokemod(pokemod) +{ +} + +inline QString PokemodWrapper::title() const +{ + return m_pokemod->title(); +} + +inline QString PokemodWrapper::version() const +{ + return m_pokemod->version(); +} + +inline QString PokemodWrapper::description() const +{ + return m_pokemod->description(); +} + +inline const MapWarpWrapper* PokemodWrapper::startWarp() const +{ + return new MapWarpWrapper(m_pokemod->mapById(m_pokemod->startMap())->warpById(m_pokemod->startWarp()), const_cast<PokemodWrapper*>(this)); +} + +inline QPixmap PokemodWrapper::walkSkin() const +{ + return m_pokemod->walkSkin(); +} + +inline QPixmap PokemodWrapper::bikeSkin() const +{ + return m_pokemod->bikeSkin(); +} + +inline QPixmap PokemodWrapper::surfSkin() const +{ + return m_pokemod->surfSkin(); +} + +inline QPixmap PokemodWrapper::flySkin() const +{ + return m_pokemod->flySkin(); +} + +inline QPixmap PokemodWrapper::fishSkin() const +{ + return m_pokemod->fishSkin(); +} + +inline QPixmap PokemodWrapper::surfFishSkin() const +{ + return m_pokemod->surfFishSkin(); +} + +inline Pokemod::Fraction PokemodWrapper::effectiveness(const TypeWrapper* attacker, const TypeWrapper* defender) const +{ + return m_pokemod->typechart(m_pokemod->typeIndex(attacker->id()), m_pokemod->typeIndex(defender->id())); +} + +const RulesWrapper* PokemodWrapper::rules() const +{ + return new RulesWrapper(m_pokemod->rules(), const_cast<PokemodWrapper*>(this)); +} + +inline const AbilityWrapper* PokemodWrapper::ability(const QString& name) const +{ + for (int i = 0; i < m_pokemod->abilityCount(); ++i) + { + if (m_pokemod->ability(i)->name() == name) + return new AbilityWrapper(m_pokemod->ability(i), const_cast<PokemodWrapper*>(this)); + } + return NULL; +} + +inline const AuthorWrapper* PokemodWrapper::author(const QString& name) const +{ + for (int i = 0; i < m_pokemod->authorCount(); ++i) + { + if (m_pokemod->author(i)->name() == name) + return new AuthorWrapper(m_pokemod->author(i), const_cast<PokemodWrapper*>(this)); + } + return NULL; +} + +inline const BadgeWrapper* PokemodWrapper::badge(const QString& name) const +{ + for (int i = 0; i < m_pokemod->badgeCount(); ++i) + { + if (m_pokemod->badge(i)->name() == name) + return new BadgeWrapper(m_pokemod->badge(i), const_cast<PokemodWrapper*>(this)); + } + return NULL; +} + +inline const CoinListWrapper* PokemodWrapper::coinList(const QString& name) const +{ + for (int i = 0; i < m_pokemod->coinListCount(); ++i) + { + if (m_pokemod->coinList(i)->name() == name) + return new CoinListWrapper(m_pokemod->coinList(i), const_cast<PokemodWrapper*>(this)); + } + return NULL; +} + +inline const EggGroupWrapper* PokemodWrapper::eggGroup(const QString& name) const +{ + for (int i = 0; i < m_pokemod->eggGroupCount(); ++i) + { + if (m_pokemod->eggGroup(i)->name() == name) + return new EggGroupWrapper(m_pokemod->eggGroup(i), const_cast<PokemodWrapper*>(this)); + } + return NULL; +} + +inline const GlobalScriptWrapper* PokemodWrapper::globalScript(const QString& name) const +{ + for (int i = 0; i < m_pokemod->globalScriptCount(); ++i) + { + if (m_pokemod->globalScript(i)->name() == name) + return new GlobalScriptWrapper(m_pokemod->globalScript(i), const_cast<PokemodWrapper*>(this)); + } + return NULL; +} + +inline const ItemWrapper* PokemodWrapper::item(const QString& name) const +{ + for (int i = 0; i < m_pokemod->itemCount(); ++i) + { + if (m_pokemod->item(i)->name() == name) + return new ItemWrapper(m_pokemod->item(i), const_cast<PokemodWrapper*>(this)); + } + return NULL; +} + +inline const ItemTypeWrapper* PokemodWrapper::itemType(const QString& name) const +{ + for (int i = 0; i < m_pokemod->itemTypeCount(); ++i) + { + if (m_pokemod->itemType(i)->name() == name) + return new ItemTypeWrapper(m_pokemod->itemType(i), const_cast<PokemodWrapper*>(this)); + } + return NULL; +} + +inline const MapWrapper* PokemodWrapper::map(const QString& name) const +{ + for (int i = 0; i < m_pokemod->mapCount(); ++i) + { + if (m_pokemod->map(i)->name() == name) + return new MapWrapper(m_pokemod->map(i), const_cast<PokemodWrapper*>(this)); + } + return NULL; +} + +inline const MoveWrapper* PokemodWrapper::move(const QString& name) const +{ + for (int i = 0; i < m_pokemod->moveCount(); ++i) + { + if (m_pokemod->move(i)->name() == name) + return new MoveWrapper(m_pokemod->move(i), const_cast<PokemodWrapper*>(this)); + } + return NULL; +} + +inline const NatureWrapper* PokemodWrapper::nature(const QString& name) const +{ + for (int i = 0; i < m_pokemod->natureCount(); ++i) + { + if (m_pokemod->nature(i)->name() == name) + return new NatureWrapper(m_pokemod->nature(i), const_cast<PokemodWrapper*>(this)); + } + return NULL; +} + +inline const SoundWrapper* PokemodWrapper::sound(const QString& name) const +{ + for (int i = 0; i < m_pokemod->soundCount(); ++i) + { + if (m_pokemod->sound(i)->name() == name) + return new SoundWrapper(m_pokemod->sound(i), const_cast<PokemodWrapper*>(this)); + } + return NULL; +} + +inline const SpeciesWrapper* PokemodWrapper::species(const QString& name) const +{ + for (int i = 0; i < m_pokemod->speciesCount(); ++i) + { + if (m_pokemod->species(i)->name() == name) + return new SpeciesWrapper(m_pokemod->species(i), const_cast<PokemodWrapper*>(this)); + } + return NULL; +} + +inline const SpriteWrapper* PokemodWrapper::sprite(const QString& name) const +{ + for (int i = 0; i < m_pokemod->spriteCount(); ++i) + { + if (m_pokemod->sprite(i)->name() == name) + return new SpriteWrapper(m_pokemod->sprite(i), const_cast<PokemodWrapper*>(this)); + } + return NULL; +} + +inline const StatusWrapper* PokemodWrapper::status(const QString& name) const +{ + for (int i = 0; i < m_pokemod->statusCount(); ++i) + { + if (m_pokemod->status(i)->name() == name) + return new StatusWrapper(m_pokemod->status(i), const_cast<PokemodWrapper*>(this)); + } + return NULL; +} + +inline const StoreWrapper* PokemodWrapper::store(const QString& name) const +{ + for (int i = 0; i < m_pokemod->storeCount(); ++i) + { + if (m_pokemod->store(i)->name() == name) + return new StoreWrapper(m_pokemod->store(i), const_cast<PokemodWrapper*>(this)); + } + return NULL; +} + +inline const TileWrapper* PokemodWrapper::tile(const QString& name) const +{ + for (int i = 0; i < m_pokemod->tileCount(); ++i) + { + if (m_pokemod->tile(i)->name() == name) + return new TileWrapper(m_pokemod->tile(i), const_cast<PokemodWrapper*>(this)); + } + return NULL; +} + +inline const TimeWrapper* PokemodWrapper::time(const QString& name) const +{ + for (int i = 0; i < m_pokemod->timeCount(); ++i) + { + if (m_pokemod->time(i)->name() == name) + return new TimeWrapper(m_pokemod->time(i), const_cast<PokemodWrapper*>(this)); + } + return NULL; +} + +inline const TrainerWrapper* PokemodWrapper::trainer(const QString& name) const +{ + for (int i = 0; i < m_pokemod->trainerCount(); ++i) + { + if (m_pokemod->trainer(i)->name() == name) + return new TrainerWrapper(m_pokemod->trainer(i), const_cast<PokemodWrapper*>(this)); + } + return NULL; +} + +inline const TypeWrapper* PokemodWrapper::type(const QString& name) const +{ + for (int i = 0; i < m_pokemod->typeCount(); ++i) + { + if (m_pokemod->type(i)->name() == name) + return new TypeWrapper(m_pokemod->type(i), const_cast<PokemodWrapper*>(this)); + } + return NULL; +} + +inline const WeatherWrapper* PokemodWrapper::weather(const QString& name) const +{ + for (int i = 0; i < m_pokemod->weatherCount(); ++i) + { + if (m_pokemod->weather(i)->name() == name) + return new WeatherWrapper(m_pokemod->weather(i), const_cast<PokemodWrapper*>(this)); + } + return NULL; +} + +} + +#endif diff --git a/pokescripting/RulesWrapper.h b/pokescripting/RulesWrapper.h new file mode 100644 index 00000000..fc816306 --- /dev/null +++ b/pokescripting/RulesWrapper.h @@ -0,0 +1,188 @@ +/* + * 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/>. + */ + +#ifndef __POKESCRIPTING_RULESWRAPPER__ +#define __POKESCRIPTING_RULESWRAPPER__ + +// Pokescripting includes +#include "ObjectWrapper.h" + +// Pokemod includes +#include "../pokemod/Rules.h" + +namespace Pokescripting +{ +class POKESCRIPTING_EXPORT RulesWrapper : public ObjectWrapper +{ + Q_OBJECT + + public: + RulesWrapper(const Pokemod::Rules* rules, QObject* parent); + public slots: + bool genderAllowed() const; + bool breedingAllowed() const; + bool criticalDomains() const; + bool useTurns() const; + int numBoxes() const; + int boxSize() const; + int maxParty() const; + int maxFight() const; + int maxPlayers() const; + int maxHeldItems() const; + int maxAbilities() const; + int maxNatures() const; + int maxMoves() const; + int maxLevel() const; + int maxStages() const; + int maxMoney() const; + bool hardCash() const; + bool allowSwitchStyle() const; + bool specialSplit() const; + bool specialDVSplit() const; + bool effortValuesAllowed() const; + int maxTotalEV() const; + int maxEVPerStat() const; + private: + RulesWrapper& operator=(const RulesWrapper& rhs); + + const Pokemod::Rules* m_rules; +}; + +inline RulesWrapper::RulesWrapper(const Pokemod::Rules* rules, QObject* parent) : + ObjectWrapper(rules, parent), + m_rules(rules) +{ +} + +inline bool RulesWrapper::genderAllowed() const +{ + return m_rules->genderAllowed(); +} + +inline bool RulesWrapper::breedingAllowed() const +{ + return m_rules->breedingAllowed(); +} + +inline bool RulesWrapper::criticalDomains() const +{ + return m_rules->criticalDomains(); +} + +inline bool RulesWrapper::useTurns() const +{ + return m_rules->useTurns(); +} + +inline int RulesWrapper::numBoxes() const +{ + return m_rules->numBoxes(); +} + +inline int RulesWrapper::boxSize() const +{ + return m_rules->boxSize(); +} + +inline int RulesWrapper::maxParty() const +{ + return m_rules->maxParty(); +} + +inline int RulesWrapper::maxFight() const +{ + return m_rules->maxFight(); +} + +inline int RulesWrapper::maxPlayers() const +{ + return m_rules->maxPlayers(); +} + +inline int RulesWrapper::maxHeldItems() const +{ + return m_rules->maxHeldItems(); +} + +inline int RulesWrapper::maxAbilities() const +{ + return m_rules->maxAbilities(); +} + +inline int RulesWrapper::maxNatures() const +{ + return m_rules->maxNatures(); +} + +inline int RulesWrapper::maxMoves() const +{ + return m_rules->maxMoves(); +} + +inline int RulesWrapper::maxLevel() const +{ + return m_rules->maxLevel(); +} + +inline int RulesWrapper::maxStages() const +{ + return m_rules->maxStages(); +} + +inline int RulesWrapper::maxMoney() const +{ + return m_rules->maxMoney(); +} + +inline bool RulesWrapper::hardCash() const +{ + return m_rules->hardCash(); +} + +inline bool RulesWrapper::allowSwitchStyle() const +{ + return m_rules->allowSwitchStyle(); +} + +inline bool RulesWrapper::specialSplit() const +{ + return m_rules->specialSplit(); +} + +inline bool RulesWrapper::specialDVSplit() const +{ + return m_rules->specialDVSplit(); +} + +inline bool RulesWrapper::effortValuesAllowed() const +{ + return m_rules->effortValuesAllowed(); +} + +inline int RulesWrapper::maxTotalEV() const +{ + return m_rules->maxTotalEV(); +} + +inline int RulesWrapper::maxEVPerStat() const +{ + return m_rules->maxEVPerStat(); +} + +} + +#endif diff --git a/pokescripting/SoundWrapper.h b/pokescripting/SoundWrapper.h new file mode 100644 index 00000000..683cca13 --- /dev/null +++ b/pokescripting/SoundWrapper.h @@ -0,0 +1,57 @@ +/* + * 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/>. + */ + +#ifndef __POKESCRIPTING_SOUNDWRAPPER__ +#define __POKESCRIPTING_SOUNDWRAPPER__ + +// Pokescripting includes +#include "ObjectWrapper.h" + +// Pokemod includes +#include "../pokemod/Sound.h" + +namespace Pokescripting +{ +class POKESCRIPTING_EXPORT SoundWrapper : public ObjectWrapper +{ + Q_OBJECT + + public: + SoundWrapper(const Pokemod::Sound* sound, QObject* parent); + public slots: + QString name() const; + // TODO: Get audio data from it + private: + SoundWrapper& operator=(const SoundWrapper& rhs); + + const Pokemod::Sound* m_sound; +}; + +inline SoundWrapper::SoundWrapper(const Pokemod::Sound* sound, QObject* parent) : + ObjectWrapper(sound, parent), + m_sound(sound) +{ +} + +inline QString SoundWrapper::name() const +{ + return m_sound->name(); +} + +} + +#endif diff --git a/pokescripting/SpeciesAbilityWrapper.h b/pokescripting/SpeciesAbilityWrapper.h new file mode 100644 index 00000000..d052d697 --- /dev/null +++ b/pokescripting/SpeciesAbilityWrapper.h @@ -0,0 +1,63 @@ +/* + * 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/>. + */ + +#ifndef __POKESCRIPTING_SPECIESABILITYWRAPPER__ +#define __POKESCRIPTING_SPECIESABILITYWRAPPER__ + +// Pokescripting includes +#include "AbilityWrapper.h" +#include "ObjectWrapper.h" + +// Pokemod includes +#include "../pokemod/SpeciesAbility.h" + +namespace Pokescripting +{ +class POKESCRIPTING_EXPORT SpeciesAbilityWrapper : public ObjectWrapper +{ + Q_OBJECT + + public: + SpeciesAbilityWrapper(const Pokemod::SpeciesAbility* ability, QObject* parent); + public slots: + const AbilityWrapper* ability() const; + int weight() const; + private: + SpeciesAbilityWrapper& operator=(const SpeciesAbilityWrapper& rhs); + + const Pokemod::SpeciesAbility* m_ability; +}; + +inline SpeciesAbilityWrapper::SpeciesAbilityWrapper(const Pokemod::SpeciesAbility* ability, QObject* parent) : + ObjectWrapper(ability, parent), + m_ability(ability) +{ +} + +inline const AbilityWrapper* SpeciesAbilityWrapper::ability() const +{ + return new AbilityWrapper(pokemod()->abilityById(m_ability->ability()), const_cast<SpeciesAbilityWrapper*>(this)); +} + +inline int SpeciesAbilityWrapper::weight() const +{ + return m_ability->weight(); +} + +} + +#endif diff --git a/pokescripting/SpeciesItemWrapper.h b/pokescripting/SpeciesItemWrapper.h new file mode 100644 index 00000000..2d82fdd8 --- /dev/null +++ b/pokescripting/SpeciesItemWrapper.h @@ -0,0 +1,63 @@ +/* + * 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/>. + */ + +#ifndef __POKESCRIPTING_SPECIESTEMWRAPPER__ +#define __POKESCRIPTING_SPECIESITEMWRAPPER__ + +// Pokescripting includes +#include "ItemWrapper.h" +#include "ObjectWrapper.h" + +// Pokemod includes +#include "../pokemod/SpeciesItem.h" + +namespace Pokescripting +{ +class POKESCRIPTING_EXPORT SpeciesItemWrapper : public ObjectWrapper +{ + Q_OBJECT + + public: + SpeciesItemWrapper(const Pokemod::SpeciesItem* item, QObject* parent); + public slots: + const ItemWrapper* item() const; + int weight() const; + private: + SpeciesItemWrapper& operator=(const SpeciesItemWrapper& rhs); + + const Pokemod::SpeciesItem* m_item; +}; + +inline SpeciesItemWrapper::SpeciesItemWrapper(const Pokemod::SpeciesItem* item, QObject* parent) : + ObjectWrapper(item, parent), + m_item(item) +{ +} + +inline const ItemWrapper* SpeciesItemWrapper::item() const +{ + return new ItemWrapper(pokemod()->itemById(m_item->item()), const_cast<SpeciesItemWrapper*>(this)); +} + +inline int SpeciesItemWrapper::weight() const +{ + return m_item->weight(); +} + +} + +#endif diff --git a/pokescripting/SpeciesMoveWrapper.h b/pokescripting/SpeciesMoveWrapper.h new file mode 100644 index 00000000..e8012f5e --- /dev/null +++ b/pokescripting/SpeciesMoveWrapper.h @@ -0,0 +1,69 @@ +/* + * 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/>. + */ + +#ifndef __POKESCRIPTING_SPECIESMOVEWRAPPER__ +#define __POKESCRIPTING_SPECIESMOVEWRAPPER__ + +// Pokescripting includes +#include "MoveWrapper.h" +#include "ObjectWrapper.h" + +// Pokemod includes +#include "../pokemod/SpeciesMove.h" + +namespace Pokescripting +{ +class POKESCRIPTING_EXPORT SpeciesMoveWrapper : public ObjectWrapper +{ + Q_OBJECT + + public: + SpeciesMoveWrapper(const Pokemod::SpeciesMove* move, QObject* parent); + public slots: + const MoveWrapper* move() const; + int level() const; + int wild() const; + private: + SpeciesMoveWrapper& operator=(const SpeciesMoveWrapper& rhs); + + const Pokemod::SpeciesMove* m_move; +}; + +inline SpeciesMoveWrapper::SpeciesMoveWrapper(const Pokemod::SpeciesMove* move, QObject* parent) : + ObjectWrapper(move, parent), + m_move(move) +{ +} + +inline const MoveWrapper* SpeciesMoveWrapper::move() const +{ + return new MoveWrapper(pokemod()->moveById(m_move->move()), const_cast<SpeciesMoveWrapper*>(this)); +} + +inline int SpeciesMoveWrapper::level() const +{ + return m_move->level(); +} + +inline int SpeciesMoveWrapper::wild() const +{ + return m_move->wild(); +} + +} + +#endif diff --git a/pokescripting/SpeciesWrapper.h b/pokescripting/SpeciesWrapper.h new file mode 100644 index 00000000..b70f802d --- /dev/null +++ b/pokescripting/SpeciesWrapper.h @@ -0,0 +1,242 @@ +/* + * 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/>. + */ + +#ifndef __POKESCRIPTING_SPECIESWRAPPER__ +#define __POKESCRIPTING_SPECIESWRAPPER__ + +// Pokescripting includes +#include "ObjectWrapper.h" +#include "SpeciesAbilityWrapper.h" +#include "SpeciesItemWrapper.h" +#include "SpeciesMoveWrapper.h" + +// Pokemod includes +#include "../pokemod/Species.h" + +namespace Pokescripting +{ +class POKESCRIPTING_EXPORT SpeciesWrapper : public ObjectWrapper +{ + Q_OBJECT + + public: + SpeciesWrapper(const Pokemod::Species* species, QObject* parent); + public slots: + QString name() const; + int baseStat(const int stat) const; + int effortValue(const int stat) const; + int growth() const; + int experienceValue() const; + int catchValue() const; + Pokemod::Fraction runChance() const; + Pokemod::Fraction fleeChance() const; + Pokemod::Fraction itemChance() const; + int pokedexNumber() const; + int weight() const; + int heightFeet() const; + int heightInches() const; + QString pokedexEntry() const; + QPixmap frontMaleSprite() const; + QPixmap backMaleSprite() const; + QPixmap frontFemaleSprite() const; + QPixmap backFemaleSprite() const; + QPixmap listSprite() const; + Pokemod::Fraction genderFactor() const; + int eggSpecies() const; + int eggSteps() const; + int nidoranGroup() const; + bool type(const int type) const; + bool eggGroup(const int eggGroup) const; + + const SpeciesAbilityWrapper* ability(const int index) const; + int abilityCount() const; + + const SpeciesItemWrapper* item(const int index) const; + int itemCount() const; + + const SpeciesMoveWrapper* move(const int index) const; + int moveCount() const; + private: + SpeciesWrapper& operator=(const SpeciesWrapper& rhs); + + const Pokemod::Species* m_species; +}; + +inline SpeciesWrapper::SpeciesWrapper(const Pokemod::Species* species, QObject* parent) : + ObjectWrapper(species, parent), + m_species(species) +{ +} + +inline QString SpeciesWrapper::name() const +{ + return m_species->name(); +} + +inline int SpeciesWrapper::baseStat(const int stat) const +{ + return m_species->baseStat(stat); +} + +inline int SpeciesWrapper::effortValue(const int stat) const +{ + return m_species->effortValue(stat); +} + +inline int SpeciesWrapper::growth() const +{ + return m_species->growth(); +} + +inline int SpeciesWrapper::experienceValue() const +{ + return m_species->experienceValue(); +} + +inline int SpeciesWrapper::catchValue() const +{ + return m_species->catchValue(); +} + +inline Pokemod::Fraction SpeciesWrapper::runChance() const +{ + return m_species->runChance(); +} + +inline Pokemod::Fraction SpeciesWrapper::fleeChance() const +{ + return m_species->fleeChance(); +} + +inline Pokemod::Fraction SpeciesWrapper::itemChance() const +{ + return m_species->itemChance(); +} + +inline int SpeciesWrapper::pokedexNumber() const +{ + return m_species->pokedexNumber(); +} + +inline int SpeciesWrapper::weight() const +{ + return m_species->weight(); +} + +inline int SpeciesWrapper::heightFeet() const +{ + return m_species->heightFeet(); +} + +inline int SpeciesWrapper::heightInches() const +{ + return m_species->heightInches(); +} + +inline QString SpeciesWrapper::pokedexEntry() const +{ + return m_species->pokedexEntry(); +} + +inline QPixmap SpeciesWrapper::frontMaleSprite() const +{ + return m_species->frontMaleSprite(); +} + +inline QPixmap SpeciesWrapper::backMaleSprite() const +{ + return m_species->backMaleSprite(); +} + +inline QPixmap SpeciesWrapper::frontFemaleSprite() const +{ + return m_species->frontFemaleSprite(); +} + +inline QPixmap SpeciesWrapper::backFemaleSprite() const +{ + return m_species->backFemaleSprite(); +} + +inline QPixmap SpeciesWrapper::listSprite() const +{ + return m_species->listSprite(); +} + +inline Pokemod::Fraction SpeciesWrapper::genderFactor() const +{ + return m_species->genderFactor(); +} + +inline int SpeciesWrapper::eggSpecies() const +{ + return m_species->eggSpecies(); +} + +inline int SpeciesWrapper::eggSteps() const +{ + return m_species->eggSteps(); +} + +inline int SpeciesWrapper::nidoranGroup() const +{ + return m_species->nidoranGroup(); +} + +inline bool SpeciesWrapper::type(const int type) const +{ + return m_species->type(type); +} + +inline bool SpeciesWrapper::eggGroup(const int eggGroup) const +{ + return m_species->eggGroup(eggGroup); +} + +inline const SpeciesAbilityWrapper* SpeciesWrapper::ability(const int index) const +{ + return new SpeciesAbilityWrapper(m_species->ability(index), const_cast<SpeciesWrapper*>(this)); +} + +inline int SpeciesWrapper::abilityCount() const +{ + return m_species->abilityCount(); +} + +inline const SpeciesItemWrapper* SpeciesWrapper::item(const int index) const +{ + return new SpeciesItemWrapper(m_species->item(index), const_cast<SpeciesWrapper*>(this)); +} + +inline int SpeciesWrapper::itemCount() const +{ + return m_species->itemCount(); +} + +inline const SpeciesMoveWrapper* SpeciesWrapper::move(const int index) const +{ + return new SpeciesMoveWrapper(m_species->move(index), const_cast<SpeciesWrapper*>(this)); +} + +inline int SpeciesWrapper::moveCount() const +{ + return m_species->moveCount(); +} + +} + +#endif diff --git a/pokescripting/SpriteWrapper.h b/pokescripting/SpriteWrapper.h new file mode 100644 index 00000000..3e94e836 --- /dev/null +++ b/pokescripting/SpriteWrapper.h @@ -0,0 +1,62 @@ +/* + * 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/>. + */ + +#ifndef __POKESCRIPTING_SPRITEWRAPPER__ +#define __POKESCRIPTING_SPRITEWRAPPER__ + +// Pokescripting includes +#include "ObjectWrapper.h" + +// Pokemod includes +#include "../pokemod/Sprite.h" + +namespace Pokescripting +{ +class POKESCRIPTING_EXPORT SpriteWrapper : public ObjectWrapper +{ + Q_OBJECT + + public: + SpriteWrapper(const Pokemod::Sprite* sprite, QObject* parent); + public slots: + QString name() const; + QPixmap sprite() const; + private: + SpriteWrapper& operator=(const SpriteWrapper& rhs); + + const Pokemod::Sprite* m_sprite; +}; + +inline SpriteWrapper::SpriteWrapper(const Pokemod::Sprite* sprite, QObject* parent) : + ObjectWrapper(sprite, parent), + m_sprite(sprite) +{ +} + +inline QString SpriteWrapper::name() const +{ + return m_sprite->name(); +} + + +inline QPixmap SpriteWrapper::sprite() const +{ + return m_sprite->sprite(); +} +} + +#endif diff --git a/pokescripting/StatusWrapper.h b/pokescripting/StatusWrapper.h new file mode 100644 index 00000000..e2a77318 --- /dev/null +++ b/pokescripting/StatusWrapper.h @@ -0,0 +1,56 @@ +/* + * 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/>. + */ + +#ifndef __POKESCRIPTING_STATUSWRAPPER__ +#define __POKESCRIPTING_STATUSWRAPPER__ + +// Pokescripting includes +#include "ObjectWrapper.h" + +// Pokemod includes +#include "../pokemod/Status.h" + +namespace Pokescripting +{ +class POKESCRIPTING_EXPORT StatusWrapper : public ObjectWrapper +{ + Q_OBJECT + + public: + StatusWrapper(const Pokemod::Status* status, QObject* parent); + public slots: + QString name() const; + private: + StatusWrapper& operator=(const StatusWrapper& rhs); + + const Pokemod::Status* m_status; +}; + +inline StatusWrapper::StatusWrapper(const Pokemod::Status* status, QObject* parent) : + ObjectWrapper(status, parent), + m_status(status) +{ +} + +inline QString StatusWrapper::name() const +{ + return m_status->name(); +} + +} + +#endif diff --git a/pokescripting/StoreWrapper.h b/pokescripting/StoreWrapper.h new file mode 100644 index 00000000..cadc527b --- /dev/null +++ b/pokescripting/StoreWrapper.h @@ -0,0 +1,62 @@ +/* + * 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/>. + */ + +#ifndef __POKESCRIPTING_STOREWRAPPER__ +#define __POKESCRIPTING_STOREWRAPPER__ + +// Pokescripting includes +#include "ObjectWrapper.h" + +// Pokemod includes +#include "../pokemod/Store.h" + +namespace Pokescripting +{ +class POKESCRIPTING_EXPORT StoreWrapper : public ObjectWrapper +{ + Q_OBJECT + + public: + StoreWrapper(const Pokemod::Store* store, QObject* parent); + public slots: + QString name() const; + bool item(const int item) const; + private: + StoreWrapper& operator=(const StoreWrapper& rhs); + + const Pokemod::Store* m_store; +}; + +inline StoreWrapper::StoreWrapper(const Pokemod::Store* store, QObject* parent) : + ObjectWrapper(store, parent), + m_store(store) +{ +} + +inline QString StoreWrapper::name() const +{ + return m_store->name(); +} + +inline bool StoreWrapper::item(const int item) const +{ + return m_store->item(item); +} + +} + +#endif diff --git a/pokescripting/TileWrapper.h b/pokescripting/TileWrapper.h new file mode 100644 index 00000000..c78a2cea --- /dev/null +++ b/pokescripting/TileWrapper.h @@ -0,0 +1,68 @@ +/* + * 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/>. + */ + +#ifndef __POKESCRIPTING_TILEWRAPPER__ +#define __POKESCRIPTING_TILEWRAPPER__ + +// Pokescripting includes +#include "ObjectWrapper.h" + +// Pokemod includes +#include "../pokemod/Tile.h" + +namespace Pokescripting +{ +class POKESCRIPTING_EXPORT TileWrapper : public ObjectWrapper +{ + Q_OBJECT + + public: + TileWrapper(const Pokemod::Tile* tile, QObject* parent); + public slots: + QString name() const; + QPixmap sprite() const; + bool from(const int direction) const; + private: + TileWrapper& operator=(const TileWrapper& rhs); + + const Pokemod::Tile* m_tile; +}; + +inline TileWrapper::TileWrapper(const Pokemod::Tile* tile, QObject* parent) : + ObjectWrapper(tile, parent), + m_tile(tile) +{ +} + +inline QString TileWrapper::name() const +{ + return m_tile->name(); +} + +inline QPixmap TileWrapper::sprite() const +{ + return m_tile->sprite(); +} + +inline bool TileWrapper::from(const int direction) const +{ + return m_tile->from(direction); +} + +} + +#endif diff --git a/pokescripting/TimeWrapper.h b/pokescripting/TimeWrapper.h new file mode 100644 index 00000000..d48df3c9 --- /dev/null +++ b/pokescripting/TimeWrapper.h @@ -0,0 +1,68 @@ +/* + * 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/>. + */ + +#ifndef __POKESCRIPTING_TIMEWRAPPER__ +#define __POKESCRIPTING_TIMEWRAPPER__ + +// Pokescripting includes +#include "ObjectWrapper.h" + +// Pokemod includes +#include "../pokemod/Time.h" + +namespace Pokescripting +{ +class POKESCRIPTING_EXPORT TimeWrapper : public ObjectWrapper +{ + Q_OBJECT + + public: + TimeWrapper(const Pokemod::Time* time, QObject* parent); + public slots: + QString name() const; + int hour() const; + int minute() const; + private: + TimeWrapper& operator=(const TimeWrapper& rhs); + + const Pokemod::Time* m_time; +}; + +inline TimeWrapper::TimeWrapper(const Pokemod::Time* time, QObject* parent) : + ObjectWrapper(time, parent), + m_time(time) +{ +} + +inline QString TimeWrapper::TimeWrapper::name() const +{ + return m_time->name(); +} + + +inline int TimeWrapper::TimeWrapper::hour() const +{ + return m_time->hour(); +} + +inline int TimeWrapper::TimeWrapper::minute() const +{ + return m_time->minute(); +} +} + +#endif diff --git a/pokescripting/TrainerWrapper.h b/pokescripting/TrainerWrapper.h new file mode 100644 index 00000000..3841bac3 --- /dev/null +++ b/pokescripting/TrainerWrapper.h @@ -0,0 +1,98 @@ +/* + * 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/>. + */ + +#ifndef __POKESCRIPTING_TRAINERWRAPPER__ +#define __POKESCRIPTING_TRAINERWRAPPER__ + +// Pokemod includes +#include "ObjectWrapper.h" + +// Pokemod includes +#include "../pokemod/Trainer.h" + +namespace Pokescripting +{ +class POKESCRIPTING_EXPORT TrainerWrapper : public ObjectWrapper +{ + Q_OBJECT + + public: + TrainerWrapper(const Pokemod::Trainer* trainer, QObject* parent); + public slots: + QString name() const; + int moneyFactor() const; + QPixmap skin() const; + int teamIntel() const; + int moveIntel() const; + int itemIntel() const; + int abilityIntel() const; + int statIntel() const; + private: + TrainerWrapper& operator=(const TrainerWrapper& rhs); + + const Pokemod::Trainer* m_trainer; +}; + +inline TrainerWrapper::TrainerWrapper(const Pokemod::Trainer* trainer, QObject* parent) : + ObjectWrapper(trainer, parent), + m_trainer(trainer) +{ +} + +inline QString TrainerWrapper::TrainerWrapper::name() const +{ + return m_trainer->name(); +} + +inline int TrainerWrapper::TrainerWrapper::moneyFactor() const +{ + return m_trainer->moneyFactor(); +} + +inline QPixmap TrainerWrapper::TrainerWrapper::skin() const +{ + return m_trainer->skin(); +} + +inline int TrainerWrapper::TrainerWrapper::teamIntel() const +{ + return m_trainer->teamIntel(); +} + +inline int TrainerWrapper::TrainerWrapper::moveIntel() const +{ + return m_trainer->moveIntel(); +} + +inline int TrainerWrapper::TrainerWrapper::itemIntel() const +{ + return m_trainer->itemIntel(); +} + +inline int TrainerWrapper::TrainerWrapper::abilityIntel() const +{ + return m_trainer->abilityIntel(); +} + +inline int TrainerWrapper::TrainerWrapper::statIntel() const +{ + return m_trainer->statIntel(); +} + +} + +#endif diff --git a/pokescripting/TypeWrapper.h b/pokescripting/TypeWrapper.h new file mode 100644 index 00000000..9c4eb730 --- /dev/null +++ b/pokescripting/TypeWrapper.h @@ -0,0 +1,62 @@ +/* + * 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/>. + */ + +#ifndef __POKESCRIPTING_TYPEWRAPPER__ +#define __POKESCRIPTING_TYPEWRAPPER__ + +// Pokescripting includes +#include "ObjectWrapper.h" + +// Pokemod includes +#include "../pokemod/Type.h" + +namespace Pokescripting +{ +class POKESCRIPTING_EXPORT TypeWrapper : public ObjectWrapper +{ + Q_OBJECT + + public: + TypeWrapper(const Pokemod::Type* type, QObject* parent); + public slots: + QString name() const; + Pokemod::Fraction stab() const; + private: + TypeWrapper& operator=(const TypeWrapper& rhs); + + const Pokemod::Type* m_type; +}; + +inline TypeWrapper::TypeWrapper(const Pokemod::Type* type, QObject* parent) : + ObjectWrapper(type, parent), + m_type(type) +{ +} + +inline QString TypeWrapper::TypeWrapper::name() const +{ + return m_type->name(); +} + +inline Pokemod::Fraction TypeWrapper::TypeWrapper::stab() const +{ + return m_type->stab(); +} + +} + +#endif diff --git a/pokescripting/WeatherWrapper.h b/pokescripting/WeatherWrapper.h new file mode 100644 index 00000000..6de468fe --- /dev/null +++ b/pokescripting/WeatherWrapper.h @@ -0,0 +1,56 @@ +/* + * 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/>. + */ + +#ifndef __POKESCRIPTING_WEATHERWRAPPER__ +#define __POKESCRIPTING_WEATHERWRAPPER__ + +// Pokescripting includes +#include "ObjectWrapper.h" + +// Pokemod includes +#include "../pokemod/Weather.h" + +namespace Pokescripting +{ +class POKESCRIPTING_EXPORT WeatherWrapper : public ObjectWrapper +{ + Q_OBJECT + + public: + WeatherWrapper(const Pokemod::Weather* weather, QObject* parent); + public slots: + QString name() const; + private: + WeatherWrapper& operator=(const WeatherWrapper& rhs); + + const Pokemod::Weather* m_weather; +}; + +inline WeatherWrapper::WeatherWrapper(const Pokemod::Weather* weather, QObject* parent) : + ObjectWrapper(weather, parent), + m_weather(weather) +{ +} + +inline QString WeatherWrapper::name() const +{ + return m_weather->name(); +} + +} + +#endif |
