summaryrefslogtreecommitdiffstats
path: root/sigbattle
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-09-06 04:12:30 +0000
committerBen Boeckel <MathStuf@gmail.com>2008-09-06 04:12:30 +0000
commit0b4b89cf8efdc15e5a8d4b6cb24a5c8a025227d9 (patch)
treea2031b9d0016fcbd49a51c0d1a2292d1f2d8b566 /sigbattle
parentb81f5bffa2772eb9bd3c67fb35485ab1ee2d96e7 (diff)
downloadsigen-0b4b89cf8efdc15e5a8d4b6cb24a5c8a025227d9.tar.gz
sigen-0b4b89cf8efdc15e5a8d4b6cb24a5c8a025227d9.tar.xz
sigen-0b4b89cf8efdc15e5a8d4b6cb24a5c8a025227d9.zip
[FIX] Renamed everything (in use) away from Poké- prefixes
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@250 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'sigbattle')
-rw-r--r--sigbattle/ATBArena.cpp10
-rw-r--r--sigbattle/ATBArena.h10
-rw-r--r--sigbattle/ATBTimer.cpp18
-rw-r--r--sigbattle/ATBTimer.h10
-rw-r--r--sigbattle/ActionQueue.h10
-rw-r--r--sigbattle/Arena.cpp30
-rw-r--r--sigbattle/Arena.h16
-rw-r--r--sigbattle/Bot.h14
-rw-r--r--sigbattle/CMakeLists.txt36
-rw-r--r--sigbattle/Containment.cpp8
-rw-r--r--sigbattle/Containment.h18
-rw-r--r--sigbattle/Ghost.cpp6
-rw-r--r--sigbattle/Ghost.h12
-rw-r--r--sigbattle/GhostBot.h10
-rw-r--r--sigbattle/Global.h16
-rw-r--r--sigbattle/Player.cpp8
-rw-r--r--sigbattle/Player.h18
-rw-r--r--sigbattle/Team.cpp24
-rw-r--r--sigbattle/Team.h12
-rw-r--r--sigbattle/TeamMember.cpp300
-rw-r--r--sigbattle/TeamMember.h114
-rw-r--r--sigbattle/TurnArena.cpp20
-rw-r--r--sigbattle/TurnArena.h12
23 files changed, 366 insertions, 366 deletions
diff --git a/sigbattle/ATBArena.cpp b/sigbattle/ATBArena.cpp
index 92a1b71e..75c5c697 100644
--- a/sigbattle/ATBArena.cpp
+++ b/sigbattle/ATBArena.cpp
@@ -18,19 +18,19 @@
// Header includes
#include "ATBArena.h"
-// Pokebattle includes
+// Sigbattle includes
#include "ATBTimer.h"
// Qt includes
#include <QtCore/QTimer>
-Pokebattle::ATBArena::ATBArena(QList<Player*> players, QObject* parent) :
+Sigbattle::ATBArena::ATBArena(QList<Player*> players, QObject* parent) :
Arena(players, parent)
{
setupBattle();
}
-void Pokebattle::ATBArena::handleAction(TeamMember* teamMember, TeamMember::Action action)
+void Sigbattle::ATBArena::handleAction(TeamMember* teamMember, TeamMember::Action action)
{
if (action.first == TeamMember::Skip)
{
@@ -40,7 +40,7 @@ void Pokebattle::ATBArena::handleAction(TeamMember* teamMember, TeamMember::Acti
Arena::handleAction(teamMember, action);
}
-void Pokebattle::ATBArena::processActions()
+void Sigbattle::ATBArena::processActions()
{
if (!m_decisions.isEmpty())
{
@@ -52,7 +52,7 @@ void Pokebattle::ATBArena::processActions()
}
}
-void Pokebattle::ATBArena::setupBattle()
+void Sigbattle::ATBArena::setupBattle()
{
m_atbTimer = new ATBTimer(this, m_decisions);
QTimer* moveTimer = new QTimer(this);
diff --git a/sigbattle/ATBArena.h b/sigbattle/ATBArena.h
index 7cb095ec..5fccf2ec 100644
--- a/sigbattle/ATBArena.h
+++ b/sigbattle/ATBArena.h
@@ -15,19 +15,19 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef __POKEBATTLE_ATBARENA__
-#define __POKEBATTLE_ATBARENA__
+#ifndef __SIGBATTLE_ATBARENA__
+#define __SIGBATTLE_ATBARENA__
-// Pokebattle includes
+// Sigbattle includes
#include "ActionQueue.h"
#include "Arena.h"
-namespace Pokebattle
+namespace Sigbattle
{
// Forward declaraions
class ATBTimer;
-class POKEBATTLE_EXPORT ATBArena : public Arena
+class SIGBATTLE_EXPORT ATBArena : public Arena
{
Q_OBJECT
diff --git a/sigbattle/ATBTimer.cpp b/sigbattle/ATBTimer.cpp
index d2f42ce2..874c6fb8 100644
--- a/sigbattle/ATBTimer.cpp
+++ b/sigbattle/ATBTimer.cpp
@@ -18,7 +18,7 @@
// Header include
#include "ATBTimer.h"
-// Pokebattle includes
+// Sigbattle includes
#include "ATBArena.h"
// Qt includes
@@ -31,7 +31,7 @@
// STL includes
#include <functional>
-Pokebattle::ATBTimer::ATBTimer(ATBArena* arena, ActionQueue& actions) :
+Sigbattle::ATBTimer::ATBTimer(ATBArena* arena, ActionQueue& actions) :
QThread(arena),
m_arena(arena),
m_actions(actions),
@@ -40,12 +40,12 @@ Pokebattle::ATBTimer::ATBTimer(ATBArena* arena, ActionQueue& actions) :
connect(m_timer, SIGNAL(timeout()), this, SLOT(update()));
}
-void Pokebattle::ATBTimer::update()
+void Sigbattle::ATBTimer::update()
{
const QList<TeamMember*> active = m_timeStates.keys();
- QtConcurrent::blockingMap(active, std::bind1st(std::mem_fun(&Pokebattle::ATBTimer::increaseMeter), this));
+ QtConcurrent::blockingMap(active, std::bind1st(std::mem_fun(&Sigbattle::ATBTimer::increaseMeter), this));
// TODO: adjust max time if needed
- QList<TeamMember*> overflow = QtConcurrent::blockingFiltered(active, std::bind1st(std::mem_fun(&Pokebattle::ATBTimer::isOverflowed), this));
+ QList<TeamMember*> overflow = QtConcurrent::blockingFiltered(active, std::bind1st(std::mem_fun(&Sigbattle::ATBTimer::isOverflowed), this));
QMultiMap<double, TeamMember*> sorter;
foreach (TeamMember* teamMember, overflow)
sorter.insert(m_timeStates[teamMember], teamMember);
@@ -54,19 +54,19 @@ void Pokebattle::ATBTimer::update()
m_actions.enqueue(requestDecision(teamMember));
}
-void Pokebattle::ATBTimer::run()
+void Sigbattle::ATBTimer::run()
{
m_timer->start(50);
exec();
}
-void Pokebattle::ATBTimer::increaseMeter(const TeamMember* teamMember)
+void Sigbattle::ATBTimer::increaseMeter(const TeamMember* teamMember)
{
// TODO: tweak this(?)
- m_timeStates[const_cast<TeamMember*>(teamMember)] += teamMember->statValue(Pokemod::ST_Speed) / 10;
+ m_timeStates[const_cast<TeamMember*>(teamMember)] += teamMember->statValue(Sigmod::ST_Speed) / 10;
}
-bool Pokebattle::ATBTimer::isOverflowed(const TeamMember* teamMember) const
+bool Sigbattle::ATBTimer::isOverflowed(const TeamMember* teamMember) const
{
return m_threshold < m_timeStates[const_cast<TeamMember*>(teamMember)];
}
diff --git a/sigbattle/ATBTimer.h b/sigbattle/ATBTimer.h
index ff84ce54..ed0edd43 100644
--- a/sigbattle/ATBTimer.h
+++ b/sigbattle/ATBTimer.h
@@ -15,10 +15,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef __POKEBATTLE_ATBTIMER__
-#define __POKEBATTLE_ATBTIMER__
+#ifndef __SIGBATTLE_ATBTIMER__
+#define __SIGBATTLE_ATBTIMER__
-// Pokebattle includes
+// Sigbattle includes
#include "Global.h"
// Qt includes
@@ -28,14 +28,14 @@
// Forward declarations
class QTimer;
-namespace Pokebattle
+namespace Sigbattle
{
class ActionQueue;
class ATBArena;
class Player;
class TeamMember;
-class POKEBATTLE_EXPORT ATBTimer : public QThread
+class SIGBATTLE_EXPORT ATBTimer : public QThread
{
Q_OBJECT
diff --git a/sigbattle/ActionQueue.h b/sigbattle/ActionQueue.h
index 3641755b..c1d27a50 100644
--- a/sigbattle/ActionQueue.h
+++ b/sigbattle/ActionQueue.h
@@ -15,10 +15,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef __POKEBATTLE_ACTIONQUEUE__
-#define __POKEBATTLE_ACTIONQUEUE__
+#ifndef __SIGBATTLE_ACTIONQUEUE__
+#define __SIGBATTLE_ACTIONQUEUE__
-// Pokebattle includes
+// Sigbattle includes
#include "Global.h"
#include "TeamMember.h"
@@ -27,9 +27,9 @@
#include <QtCore/QMutexLocker>
#include <QtCore/QQueue>
-namespace Pokebattle
+namespace Sigbattle
{
-class POKEBATTLE_EXPORT ActionQueue : public QQueue<TeamMember::RequestedAction>
+class SIGBATTLE_EXPORT ActionQueue : public QQueue<TeamMember::RequestedAction>
{
public:
ActionQueue();
diff --git a/sigbattle/Arena.cpp b/sigbattle/Arena.cpp
index 84c98dd9..d6a819a1 100644
--- a/sigbattle/Arena.cpp
+++ b/sigbattle/Arena.cpp
@@ -18,11 +18,11 @@
// Header include
#include "Arena.h"
-// Pokebattle includes
+// Sigbattle includes
#include "Player.h"
-// Pokemod includes
-#include "../pokemod/Script.h"
+// Sigmod includes
+#include "../sigmod/Script.h"
// Qt includes
#include <QtCore/QtConcurrentRun>
@@ -32,18 +32,18 @@
#include <kross/core/actioncollection.h>
#include <kross/core/manager.h>
-Pokebattle::TeamMember::RequestedAction Pokebattle::requestDecision(TeamMember* teamMember)
+Sigbattle::TeamMember::RequestedAction Sigbattle::requestDecision(TeamMember* teamMember)
{
return TeamMember::RequestedAction(teamMember, QtConcurrent::run(decision, teamMember));
}
-Pokebattle::TeamMember::Action Pokebattle::decision(TeamMember* teamMember)
+Sigbattle::TeamMember::Action Sigbattle::decision(TeamMember* teamMember)
{
return teamMember->requestAction();
}
-Pokebattle::Arena::Arena(QList<Player*> players, QObject* parent) :
- Pokescripting::Config(parent),
+Sigbattle::Arena::Arena(QList<Player*> players, QObject* parent) :
+ Sigscript::Config(parent),
m_players(players),
m_id(QUuid::createUuid())
{
@@ -53,20 +53,20 @@ Pokebattle::Arena::Arena(QList<Player*> players, QObject* parent) :
player->enterArena(this);
}
-Pokebattle::Arena::~Arena()
+Sigbattle::Arena::~Arena()
{
delete m_actions;
}
-QList<Pokebattle::TeamMember*> Pokebattle::Arena::active() const
+QList<Sigbattle::TeamMember*> Sigbattle::Arena::active() const
{
- QList<Pokebattle::TeamMember*> active;
+ QList<Sigbattle::TeamMember*> active;
foreach (Player* player, m_players)
active += player->active();
return active;
}
-int Pokebattle::Arena::numActiveTeams() const
+int Sigbattle::Arena::numActiveTeams() const
{
int active = 0;
foreach (Player* player, m_players)
@@ -74,7 +74,7 @@ int Pokebattle::Arena::numActiveTeams() const
return active;
}
-void Pokebattle::Arena::registerScript(const QString& name, const Pokemod::Script& script)
+void Sigbattle::Arena::registerScript(const QString& name, const Sigmod::Script& script)
{
Kross::Action* action = new Kross::Action(m_actions, name);
action->setInterpreter(script.interpreter());
@@ -83,12 +83,12 @@ void Pokebattle::Arena::registerScript(const QString& name, const Pokemod::Scrip
action->trigger();
}
-void Pokebattle::Arena::cleanUp()
+void Sigbattle::Arena::cleanUp()
{
// TODO: clean up everything
}
-void Pokebattle::Arena::handleAction(TeamMember* teamMember, TeamMember::Action action)
+void Sigbattle::Arena::handleAction(TeamMember* teamMember, TeamMember::Action action)
{
switch (action.first)
{
@@ -111,7 +111,7 @@ void Pokebattle::Arena::handleAction(TeamMember* teamMember, TeamMember::Action
}
}
-void Pokebattle::Arena::setupBattle()
+void Sigbattle::Arena::setupBattle()
{
// TODO: setup all the battle stuff
}
diff --git a/sigbattle/Arena.h b/sigbattle/Arena.h
index 9a3a69e9..b3c53c47 100644
--- a/sigbattle/Arena.h
+++ b/sigbattle/Arena.h
@@ -15,10 +15,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef __POKEBATTLE_ARENA__
-#define __POKEBATTLE_ARENA__
+#ifndef __SIGBATTLE_ARENA__
+#define __SIGBATTLE_ARENA__
-// Pokebattle includes
+// Sigbattle includes
#include "Global.h"
#include "Team.h"
#include "TeamMember.h"
@@ -36,16 +36,16 @@ namespace Kross
class Action;
class ActionCollection;
}
-namespace Pokemod
+namespace Sigmod
{
class Script;
}
-namespace Pokebattle
+namespace Sigbattle
{
class Player;
-class POKEBATTLE_EXPORT Arena : public Pokescripting::Config
+class SIGBATTLE_EXPORT Arena : public Sigscript::Config
{
Q_OBJECT
@@ -61,7 +61,7 @@ class POKEBATTLE_EXPORT Arena : public Pokescripting::Config
void battleStart();
void battleEnd();
public slots:
- void registerScript(const QString& name, const Pokemod::Script& script);
+ void registerScript(const QString& name, const Sigmod::Script& script);
protected slots:
void cleanUp();
protected:
@@ -79,6 +79,6 @@ TeamMember::RequestedAction requestDecision(TeamMember* teamMember);
TeamMember::Action decision(TeamMember* teamMember);
}
-Q_DECLARE_METATYPE(Pokebattle::Arena*)
+Q_DECLARE_METATYPE(Sigbattle::Arena*)
#endif
diff --git a/sigbattle/Bot.h b/sigbattle/Bot.h
index fef5d449..b2bb8f9d 100644
--- a/sigbattle/Bot.h
+++ b/sigbattle/Bot.h
@@ -15,32 +15,32 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef __POKEBATTLE_BOT__
-#define __POKEBATTLE_BOT__
+#ifndef __SIGBATTLE_BOT__
+#define __SIGBATTLE_BOT__
-// Pokebattle includes
+// Sigbattle includes
#include "Player.h"
// Standard library includes
#include <climits>
// Forward declarations
-namespace Pokemod
+namespace Sigmod
{
class MapTrainer;
}
-namespace Pokebattle
+namespace Sigbattle
{
class Arena;
class GhostBot;
-class POKEBATTLE_EXPORT Bot : public Player
+class SIGBATTLE_EXPORT Bot : public Player
{
Q_OBJECT
public:
- Bot(const Pokemod::MapTrainer& trainer);
+ Bot(const Sigmod::MapTrainer& trainer);
signals:
public slots:
protected slots:
diff --git a/sigbattle/CMakeLists.txt b/sigbattle/CMakeLists.txt
index ec6ebcc8..5b16acd7 100644
--- a/sigbattle/CMakeLists.txt
+++ b/sigbattle/CMakeLists.txt
@@ -1,12 +1,12 @@
-PROJECT(pokebattle)
+PROJECT(sigbattle)
IF(NOT BUILT_FROM_ROOT)
MESSAGE(FATAL_ERROR "Not built from source root")
ENDIF(NOT BUILT_FROM_ROOT)
-ADD_DEFINITIONS(-DMAKE_POKEBATTLE_LIB)
+ADD_DEFINITIONS(-DMAKE_SIGBATTLE_LIB)
-SET(pokebattle_MOC_HEADERS
+SET(sigbattle_MOC_HEADERS
Arena.h
ATBArena.h
ATBTimer.h
@@ -19,15 +19,15 @@ SET(pokebattle_MOC_HEADERS
TeamMember.h
TurnArena.h
)
-QT4_WRAP_CPP(pokebattle_MOC_SRCS ${pokebattle_MOC_HEADERS})
-SET(pokebattle_HEADERS
- ${pokebattle_MOC_HEADERS}
+QT4_WRAP_CPP(sigbattle_MOC_SRCS ${sigbattle_MOC_HEADERS})
+SET(sigbattle_HEADERS
+ ${sigbattle_MOC_HEADERS}
ActionQueue.h
)
-SET(pokebattle_DEVEL
- ${pokebattle_HEADERS}
+SET(sigbattle_DEVEL
+ ${sigbattle_HEADERS}
)
-SET(pokebattle_SRCS
+SET(sigbattle_SRCS
Arena.cpp
ATBArena.cpp
ATBTimer.cpp
@@ -39,32 +39,32 @@ SET(pokebattle_SRCS
TurnArena.cpp
)
-ADD_LIBRARY(pokebattle
- ${pokebattle_SRCS}
- ${pokebattle_MOC_SRCS}
+ADD_LIBRARY(sigbattle
+ ${sigbattle_SRCS}
+ ${sigbattle_MOC_SRCS}
)
-SET_TARGET_PROPERTIES(pokebattle
+SET_TARGET_PROPERTIES(sigbattle
PROPERTIES
VERSION ${POKEGEN_VERSION}
SOVERSION ${POKEGEN_SOVERSION}
LINK_INTERFACE_LIBRARIES ""
)
-TARGET_LINK_LIBRARIES(pokebattle
+TARGET_LINK_LIBRARIES(sigbattle
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
${KDE4_KROSSCORE_LIBRARY}
- pokemod
- pokescripting
+ sigmod
+ sigscript
)
INSTALL(
- TARGETS pokebattle
+ TARGETS sigbattle
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}
COMPONENT runtime
)
INSTALL(
- FILES ${pokebattle_DEVEL}
+ FILES ${sigbattle_DEVEL}
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/${CMAKE_PROJECT_NAME}/${PROJECT_NAME}
COMPONENT development
)
diff --git a/sigbattle/Containment.cpp b/sigbattle/Containment.cpp
index 7dd31002..efe59712 100644
--- a/sigbattle/Containment.cpp
+++ b/sigbattle/Containment.cpp
@@ -18,17 +18,17 @@
// Header include
#include "Containment.h"
-Pokebattle::Containment::Containment(QObject* parent) :
+Sigbattle::Containment::Containment(QObject* parent) :
QObject(parent)
{
}
-QList<Pokebattle::TeamMember*> Pokebattle::Containment::members() const
+QList<Sigbattle::TeamMember*> Sigbattle::Containment::members() const
{
return m_members;
}
-Pokescripting::PokemodWrapper* Pokebattle::Containment::pokemod() const
+Sigscript::SigmodWrapper* Sigbattle::Containment::sigmod() const
{
- // TODO: return PokemodWrapper
+ // TODO: return SigmodWrapper
}
diff --git a/sigbattle/Containment.h b/sigbattle/Containment.h
index e19061e9..52fbfbf2 100644
--- a/sigbattle/Containment.h
+++ b/sigbattle/Containment.h
@@ -15,10 +15,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef __POKEBATTLE_CONTAINMENT__
-#define __POKEBATTLE_CONTAINMENT__
+#ifndef __SIGBATTLE_CONTAINMENT__
+#define __SIGBATTLE_CONTAINMENT__
-// Pokebattle includes
+// Sigbattle includes
#include "Global.h"
// Qt includes
@@ -26,16 +26,16 @@
#include <QtCore/QObject>
// Forward declarations
-namespace Pokescripting
+namespace Sigscript
{
-class PokemodWrapper;
+class SigmodWrapper;
}
-namespace Pokebattle
+namespace Sigbattle
{
class TeamMember;
-class POKEBATTLE_EXPORT Containment : public QObject
+class SIGBATTLE_EXPORT Containment : public QObject
{
Q_OBJECT
@@ -46,7 +46,7 @@ class POKEBATTLE_EXPORT Containment : public QObject
virtual bool isMutable() const = 0;
- Pokescripting::PokemodWrapper* pokemod() const;
+ Sigscript::SigmodWrapper* sigmod() const;
signals:
public slots:
protected slots:
@@ -54,6 +54,6 @@ class POKEBATTLE_EXPORT Containment : public QObject
QList<TeamMember*> m_members;
};
}
-Q_DECLARE_METATYPE(Pokebattle::Containment*)
+Q_DECLARE_METATYPE(Sigbattle::Containment*)
#endif
diff --git a/sigbattle/Ghost.cpp b/sigbattle/Ghost.cpp
index 4750636a..d993341e 100644
--- a/sigbattle/Ghost.cpp
+++ b/sigbattle/Ghost.cpp
@@ -18,7 +18,7 @@
// Header include
#include "Ghost.h"
-// Ghost(const PokeMod::Pokemod& par, const unsigned s, const unsigned l, const unsigned t) :
+// Ghost(const PokeMod::Sigmod& par, const unsigned s, const unsigned l, const unsigned t) :
// Pokemon(par, s, l),
// teamSize(t),
// unknownMoves(par->GetMaxMoves())
@@ -28,11 +28,11 @@
// dv[i] = 0;
// statExp[i] = 0;
// minStats[i] = GetStat(i);
-// dv[i] = pokemod->GetMaxDV();
+// dv[i] = sigmod->GetMaxDV();
// statExp[i] = 65535;
// maxStats[i] = GetStat(i);
// }
-// Species* pkmn = pokemod->GetSpeciesByID(s);
+// Species* pkmn = sigmod->GetSpeciesByID(s);
// if (pkmn->GetNumAbilities() == 1)
// FeedAbility(pkmn->GetAbility(0));
// }
diff --git a/sigbattle/Ghost.h b/sigbattle/Ghost.h
index 325f7108..5e187873 100644
--- a/sigbattle/Ghost.h
+++ b/sigbattle/Ghost.h
@@ -15,20 +15,20 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef __POKEBATTLE_GHOST__
-#define __POKEBATTLE_GHOST__
+#ifndef __SIGBATTLE_GHOST__
+#define __SIGBATTLE_GHOST__
-// Pokebattle includes
+// Sigbattle includes
#include "TeamMember.h"
-namespace Pokebattle
+namespace Sigbattle
{
-class POKEBATTLE_EXPORT Ghost : public TeamMember
+class SIGBATTLE_EXPORT Ghost : public TeamMember
{
Q_OBJECT
// public:
-// Ghost(const PokeMod::Pokemod& par, const unsigned s, const unsigned l);
+// Ghost(const PokeMod::Sigmod& par, const unsigned s, const unsigned l);
//
// void FeedAttack(const unsigned actualDamage, const unsigned stat, const unsigned otherLevel, const unsigned power, const bool isAttacker);
// void FeedItem(const unsigned i);
diff --git a/sigbattle/GhostBot.h b/sigbattle/GhostBot.h
index 459f2ccf..ae086208 100644
--- a/sigbattle/GhostBot.h
+++ b/sigbattle/GhostBot.h
@@ -15,15 +15,15 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef __POKEBATTLE_GHOSTBOT__
-#define __POKEBATTLE_GHOSTBOT__
+#ifndef __SIGBATTLE_GHOSTBOT__
+#define __SIGBATTLE_GHOSTBOT__
-// Pokebattle includes
+// Sigbattle includes
#include "Player.h"
-namespace Pokebattle
+namespace Sigbattle
{
-class POKEBATTLE_EXPORT GhostBot : public Player
+class SIGBATTLE_EXPORT GhostBot : public Player
{
Q_OBJECT
};
diff --git a/sigbattle/Global.h b/sigbattle/Global.h
index 713d8c9d..00b91539 100644
--- a/sigbattle/Global.h
+++ b/sigbattle/Global.h
@@ -15,24 +15,24 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef __POKEBATTLE_GLOBAL__
-#define __POKEBATTLE_GLOBAL__
+#ifndef __SIGBATTLE_GLOBAL__
+#define __SIGBATTLE_GLOBAL__
// KDE includes
#include <kdemacros.h>
-#ifndef POKEBATTLE_EXPORT
-# ifdef MAKE_POKEBATTLE_LIB
+#ifndef SIGBATTLE_EXPORT
+# ifdef MAKE_SIGBATTLE_LIB
/* We are building this library */
-# define POKEBATTLE_EXPORT KDE_EXPORT
+# define SIGBATTLE_EXPORT KDE_EXPORT
# else
/* We are using this library */
-# define POKEBATTLE_EXPORT KDE_IMPORT
+# define SIGBATTLE_EXPORT KDE_IMPORT
# endif
#endif
-# ifndef POKEBATTLE_EXPORT_DEPRECATED
-# define POKEBATTLE_EXPORT_DEPRECATED KDE_DEPRECATED POKEBATTLE_EXPORT
+# ifndef SIGBATTLE_EXPORT_DEPRECATED
+# define SIGBATTLE_EXPORT_DEPRECATED KDE_DEPRECATED SIGBATTLE_EXPORT
# endif
#endif
diff --git a/sigbattle/Player.cpp b/sigbattle/Player.cpp
index 13e6076a..20737775 100644
--- a/sigbattle/Player.cpp
+++ b/sigbattle/Player.cpp
@@ -18,24 +18,24 @@
// Header include
#include "Player.h"
-Pokebattle::Player::Player(QObject* parent) :
+Sigbattle::Player::Player(QObject* parent) :
Team(parent),
m_arena(NULL)
{
}
-void Pokebattle::Player::enterArena(Arena* arena)
+void Sigbattle::Player::enterArena(Arena* arena)
{
// TODO: Get a list of the active members
// TODO: Let them know that they are active
}
-QList<Pokebattle::TeamMember*> Pokebattle::Player::active()
+QList<Sigbattle::TeamMember*> Sigbattle::Player::active()
{
// TODO: return active members
}
-void Pokebattle::Player::exitArena()
+void Sigbattle::Player::exitArena()
{
// TODO: Tell all active members that they can leave now
}
diff --git a/sigbattle/Player.h b/sigbattle/Player.h
index 04b3d872..765c0263 100644
--- a/sigbattle/Player.h
+++ b/sigbattle/Player.h
@@ -15,10 +15,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef __POKEBATTLE_PLAYER__
-#define __POKEBATTLE_PLAYER__
+#ifndef __SIGBATTLE_PLAYER__
+#define __SIGBATTLE_PLAYER__
-// Pokebattle includes
+// Sigbattle includes
#include "Global.h"
#include "Team.h"
#include "TeamMember.h"
@@ -27,16 +27,16 @@
#include <QtCore/QObject>
// Forward declarations
-namespace Pokemod
+namespace Sigmod
{
-class Pokemod;
+class Sigmod;
}
-namespace Pokebattle
+namespace Sigbattle
{
class Team;
-class POKEBATTLE_EXPORT Player : public Team
+class SIGBATTLE_EXPORT Player : public Team
{
Q_OBJECT
@@ -47,7 +47,7 @@ class POKEBATTLE_EXPORT Player : public Team
QList<TeamMember*> active();
- const Pokemod::Pokemod* pokemod() const;
+ const Sigmod::Sigmod* sigmod() const;
signals:
public slots:
void exitArena();
@@ -58,6 +58,6 @@ class POKEBATTLE_EXPORT Player : public Team
Arena* m_arena;
};
}
-Q_DECLARE_METATYPE(Pokebattle::Player*)
+Q_DECLARE_METATYPE(Sigbattle::Player*)
#endif
diff --git a/sigbattle/Team.cpp b/sigbattle/Team.cpp
index 22adea08..91aea643 100644
--- a/sigbattle/Team.cpp
+++ b/sigbattle/Team.cpp
@@ -18,13 +18,13 @@
// Header include
#include "Team.h"
-Pokebattle::Team::Team(QObject* parent) :
+Sigbattle::Team::Team(QObject* parent) :
Containment(parent)
{
// TODO: construct
}
-// Team::Team(const PokeMod::Pokemod& par) :
+// Team::Team(const PokeMod::Sigmod& par) :
// active(0),
// parent(par)
// {
@@ -46,28 +46,28 @@ Pokebattle::Team::Team(QObject* parent) :
// }
// }
//
-// void Team::AddPokemon(Pokemon& p)
+// void Team::AddMember(Member& p)
// {
-// pokemon.append(&p);
+// m_member.append(&p);
// }
//
-// void Team::SwapPokemon(const unsigned a, const unsigned b)
+// void Team::SwapMember(const unsigned a, const unsigned b)
// {
-// if ((a < pokemon.size()) && (b < pokemon.size()))
+// if ((a < m_member.size()) && (b < m_member.size()))
// {
-// Pokemon* p = pokemon[a];
-// pokemon[a] = pokemon[b];
-// pokemon[b] = p;
+// Member* p = m_member[a];
+// m_member[a] = m_member[b];
+// m_member[b] = p;
// }
// }
//
-// bool Team::SetActivePokemon(const unsigned a)
+// bool Team::SetActiveMember(const unsigned a)
// {
-// if ((a < pokemon.size()) && pokemon[a]->CanFight())
+// if ((a < m_member.size()) && m_member[a]->CanFight())
// active = a;
// }
-bool Pokebattle::Team::isMutable() const
+bool Sigbattle::Team::isMutable() const
{
return true;
}
diff --git a/sigbattle/Team.h b/sigbattle/Team.h
index 63a85095..fdb359eb 100644
--- a/sigbattle/Team.h
+++ b/sigbattle/Team.h
@@ -15,18 +15,18 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef __POKEBATTLE_TEAM__
-#define __POKEBATTLE_TEAM__
+#ifndef __SIGBATTLE_TEAM__
+#define __SIGBATTLE_TEAM__
-// Pokebattle includes
+// Sigbattle includes
#include "Containment.h"
-namespace Pokebattle
+namespace Sigbattle
{
// Forward declarations
class Arena;
-class POKEBATTLE_EXPORT Team : public Containment
+class SIGBATTLE_EXPORT Team : public Containment
{
Q_OBJECT
@@ -42,6 +42,6 @@ class POKEBATTLE_EXPORT Team : public Containment
Arena* m_arena;
};
}
-Q_DECLARE_METATYPE(Pokebattle::Team*)
+Q_DECLARE_METATYPE(Sigbattle::Team*)
#endif
diff --git a/sigbattle/TeamMember.cpp b/sigbattle/TeamMember.cpp
index 84727cb7..1fa0843c 100644
--- a/sigbattle/TeamMember.cpp
+++ b/sigbattle/TeamMember.cpp
@@ -18,27 +18,27 @@
// Header include
#include "TeamMember.h"
-// Pokebattle includes
+// Sigbattle includes
#include "Arena.h"
#include "Containment.h"
#include "Player.h"
-// Pokescripting includes
-#include "../pokescripting/AbilityWrapper.h"
-#include "../pokescripting/ItemWrapper.h"
-#include "../pokescripting/MapTrainerTeamMemberWrapper.h"
-#include "../pokescripting/MoveWrapper.h"
-#include "../pokescripting/NatureWrapper.h"
-#include "../pokescripting/PokemodWrapper.h"
-#include "../pokescripting/RulesWrapper.h"
-#include "../pokescripting/StatusWrapper.h"
-#include "../pokescripting/SpeciesWrapper.h"
-#include "../pokescripting/SpeciesAbilityWrapper.h"
-#include "../pokescripting/SpeciesItemWrapper.h"
-#include "../pokescripting/SpeciesMoveWrapper.h"
-
-// Pokemod includes
-#include "../pokemod/Hat.h"
+// Sigscript includes
+#include "../sigscript/AbilityWrapper.h"
+#include "../sigscript/ItemWrapper.h"
+#include "../sigscript/MapTrainerTeamMemberWrapper.h"
+#include "../sigscript/MoveWrapper.h"
+#include "../sigscript/NatureWrapper.h"
+#include "../sigscript/RulesWrapper.h"
+#include "../sigscript/SigmodWrapper.h"
+#include "../sigscript/StatusWrapper.h"
+#include "../sigscript/SpeciesWrapper.h"
+#include "../sigscript/SpeciesAbilityWrapper.h"
+#include "../sigscript/SpeciesItemWrapper.h"
+#include "../sigscript/SpeciesMoveWrapper.h"
+
+// Sigmod includes
+#include "../sigmod/Hat.h"
// Qt includes
#include <QtCore/QUuid>
@@ -54,13 +54,13 @@
// TODO: Current HP
// TODO: Script cleanup (battle)
-int Pokebattle::actionPriority(const TeamMember* teamMember, const TeamMember::Action& action)
+int Sigbattle::actionPriority(const TeamMember* teamMember, const TeamMember::Action& action)
{
int priority = INT_MAX;
switch (action.first)
{
case TeamMember::Attack:
- priority = teamMember->pokemod()->move(action.second.first.toString())->priority();
+ priority = teamMember->sigmod()->move(action.second.first.toString())->priority();
break;
case TeamMember::Item:
priority = INT_MIN / 3;
@@ -84,13 +84,13 @@ int Pokebattle::actionPriority(const TeamMember* teamMember, const TeamMember::A
return priority;
}
-Pokebattle::TeamMember::TeamMember(const int speciesId, const QString& name, const int level, Containment* containment, const bool suppressItems) :
- Pokescripting::Config(containment),
+Sigbattle::TeamMember::TeamMember(const int speciesId, const QString& name, const int level, Containment* containment, const bool suppressItems) :
+ Sigscript::Config(containment),
m_containment(containment),
m_id(QUuid::createUuid())
{
makeConnections();
- setSpecies(pokemod()->species(speciesId));
+ setSpecies(sigmod()->species(speciesId));
if (name.isEmpty())
setName(m_species->name());
else
@@ -106,22 +106,22 @@ Pokebattle::TeamMember::TeamMember(const int speciesId, const QString& name, con
m_gender = (m_species->genderFactor().poll() ? Male : Female);
else
m_gender = Genderless;
- for (int i = 0; i < Pokemod::ST_End_GSC; ++i)
+ for (int i = 0; i < Sigmod::ST_End_GSC; ++i)
m_statExp[i] = 0;
if (m_containment->isMutable())
{
- const Pokemod::Script script = m_species->evolution();
+ const Sigmod::Script script = m_species->evolution();
Kross::Action* evolution = new Kross::Action(Kross::Manager::self().actionCollection()->collection("evolutions"), QString("evolution-%1").arg(QUuid::createUuid().toString()));
evolution->setInterpreter(script.interpreter());
evolution->setCode(script.script().toUtf8());
evolution->addObject(this, "owner", Kross::ChildrenInterface::AutoConnectSignals);
evolution->trigger();
}
- m_currentHp = statValue(Pokemod::ST_HP);
+ m_currentHp = statValue(Sigmod::ST_HP);
}
-Pokebattle::TeamMember::TeamMember(Pokescripting::MapTrainerTeamMemberWrapper* teamMember, Containment* containment) :
- Pokescripting::Config(containment),
+Sigbattle::TeamMember::TeamMember(Sigscript::MapTrainerTeamMemberWrapper* teamMember, Containment* containment) :
+ Sigscript::Config(containment),
m_containment(containment),
m_id(QUuid::createUuid())
{
@@ -138,116 +138,116 @@ Pokebattle::TeamMember::TeamMember(Pokescripting::MapTrainerTeamMemberWrapper* t
m_gender = (m_species->genderFactor().poll() ? Male : Female);
else
m_gender = Genderless;
- for (int i = 0; i < Pokemod::ST_End_GSC; ++i)
+ for (int i = 0; i < Sigmod::ST_End_GSC; ++i)
m_statExp[i] = 0;
- m_currentHp = statValue(Pokemod::ST_HP);
+ m_currentHp = statValue(Sigmod::ST_HP);
}
-QUuid Pokebattle::TeamMember::id() const
+QUuid Sigbattle::TeamMember::id() const
{
return m_id;
}
-QString Pokebattle::TeamMember::name() const
+QString Sigbattle::TeamMember::name() const
{
if (value("name").canConvert<QString>())
return value("name").toString();
return m_name;
}
-long long Pokebattle::TeamMember::currentHp() const
+long long Sigbattle::TeamMember::currentHp() const
{
return m_currentHp;
}
-Pokescripting::SpeciesWrapper* Pokebattle::TeamMember::species() const
+Sigscript::SpeciesWrapper* Sigbattle::TeamMember::species() const
{
- if (value("species").canConvert<Pokescripting::SpeciesWrapper*>())
- return value("species").value<Pokescripting::SpeciesWrapper*>();
+ if (value("species").canConvert<Sigscript::SpeciesWrapper*>())
+ return value("species").value<Sigscript::SpeciesWrapper*>();
return m_species;
}
-int Pokebattle::TeamMember::level() const
+int Sigbattle::TeamMember::level() const
{
return m_level;
}
-Pokebattle::TeamMember::Gender Pokebattle::TeamMember::gender() const
+Sigbattle::TeamMember::Gender Sigbattle::TeamMember::gender() const
{
if (value("gender").canConvert<Gender>())
return value("gender").value<Gender>();
return m_gender;
}
-long long Pokebattle::TeamMember::levelExperience() const
+long long Sigbattle::TeamMember::levelExperience() const
{
if (value("levelExperience").canConvert<long long>())
return value("levelExperience").toLongLong();
return m_levelExp;
}
-int Pokebattle::TeamMember::baseStat(const Pokemod::Stat stat) const
+int Sigbattle::TeamMember::baseStat(const Sigmod::Stat stat) const
{
if (value("overrideBaseStats").canConvert<bool>() && value("overrideBaseStats").toBool())
return species()->baseStat(stat);
return m_species->baseStat(stat);
}
-long long Pokebattle::TeamMember::statExperience(const Pokemod::Stat stat) const
+long long Sigbattle::TeamMember::statExperience(const Sigmod::Stat stat) const
{
- const QString valueName = QString("statExperience-%1").arg((pokemod()->rules()->specialSplit() ? Pokemod::StatGSCStr : Pokemod::StatRBYStr)[stat]);
+ const QString valueName = QString("statExperience-%1").arg((sigmod()->rules()->specialSplit() ? Sigmod::StatGSCStr : Sigmod::StatRBYStr)[stat]);
if (value(valueName).canConvert<long long>())
return value(valueName).toLongLong();
return m_statExp[stat];
}
-int Pokebattle::TeamMember::dv(const Pokemod::Stat stat) const
+int Sigbattle::TeamMember::dv(const Sigmod::Stat stat) const
{
- const QString valueName = QString("dv-%1").arg((pokemod()->rules()->specialSplit() ? Pokemod::StatGSCStr : Pokemod::StatRBYStr)[stat]);
+ const QString valueName = QString("dv-%1").arg((sigmod()->rules()->specialSplit() ? Sigmod::StatGSCStr : Sigmod::StatRBYStr)[stat]);
if (value(valueName).canConvert<int>())
{
const int dv = value(valueName).toInt();
- if (dv < (pokemod()->rules()->specialDVSplit() ? 32 : 16))
+ if (dv < (sigmod()->rules()->specialDVSplit() ? 32 : 16))
return dv;
}
return m_dv[stat];
}
-long long Pokebattle::TeamMember::statValue(const Pokemod::Stat stat, const long long exp) const
+long long Sigbattle::TeamMember::statValue(const Sigmod::Stat stat, const long long exp) const
{
long long statValue;
if (exp < 0)
statValue = statExperience(stat);
else
statValue = exp;
- if (!pokemod()->rules()->effortValuesAllowed() && statValue)
+ if (!sigmod()->rules()->effortValuesAllowed() && statValue)
statValue = sqrt(statValue - 1) + 1;
statValue >>= 2;
statValue += baseStat(stat) << 1;
- if (pokemod()->rules()->specialDVSplit())
+ if (sigmod()->rules()->specialDVSplit())
{
- if (stat == Pokemod::ST_SpecialDefense)
- statValue += dv(Pokemod::ST_Special) << 1;
+ if (stat == Sigmod::ST_SpecialDefense)
+ statValue += dv(Sigmod::ST_Special) << 1;
else
statValue += dv(stat) << 1;
}
else
statValue += dv(stat);
- statValue *= double(m_level) / pokemod()->rules()->maxLevel();
- if (stat == Pokemod::ST_HP)
+ statValue *= double(m_level) / sigmod()->rules()->maxLevel();
+ if (stat == Sigmod::ST_HP)
statValue += 10 + m_level;
else
{
statValue += 5;
- Pokemod::Fraction multiplier;
- foreach (Pokescripting::NatureWrapper* nature, m_natures)
+ Sigmod::Fraction multiplier;
+ foreach (Sigscript::NatureWrapper* nature, m_natures)
multiplier *= nature->stat(stat);
statValue *= multiplier;
}
return statValue;
}
-long long Pokebattle::TeamMember::calcExp(int level) const
+long long Sigbattle::TeamMember::calcExp(int level) const
{
if (level < 0)
level = m_level;
@@ -255,7 +255,7 @@ long long Pokebattle::TeamMember::calcExp(int level) const
const long long cube = square * level;
switch (m_species->growth())
{
- case Pokemod::Species::Fluctuating:
+ case Sigmod::Species::Fluctuating:
if (level <= 15)
return cube * ((24 + (level + 1) / 3) / 50.0);
else if (level <= 35)
@@ -267,15 +267,15 @@ long long Pokebattle::TeamMember::calcExp(int level) const
return cube * (23 + level) / 75;
else
return 5 * cube / 3;
- case Pokemod::Species::Fading:
+ case Sigmod::Species::Fading:
return 6 * cube / 5 - 15 * square + 100 * level - 140;
- case Pokemod::Species::Slow:
+ case Sigmod::Species::Slow:
return 5 * cube / 4;
- case Pokemod::Species::Normal:
+ case Sigmod::Species::Normal:
return cube;
- case Pokemod::Species::Fast:
+ case Sigmod::Species::Fast:
return 4 * cube / 5;
- case Pokemod::Species::Erratic:
+ case Sigmod::Species::Erratic:
{
const double p[] = {0.000, 0.008, 0.014};
if (level <= 50)
@@ -296,7 +296,7 @@ long long Pokebattle::TeamMember::calcExp(int level) const
return -1;
}
-bool Pokebattle::TeamMember::canLearnMove(Pokescripting::MoveWrapper* move) const
+bool Sigbattle::TeamMember::canLearnMove(Sigscript::MoveWrapper* move) const
{
for (int i = 0; i < m_species->moveCount(); ++i)
{
@@ -306,63 +306,63 @@ bool Pokebattle::TeamMember::canLearnMove(Pokescripting::MoveWrapper* move) cons
return false;
}
-void Pokebattle::TeamMember::boostLevels(const int levels)
+void Sigbattle::TeamMember::boostLevels(const int levels)
{
- if ((m_level + levels) < pokemod()->rules()->maxLevel())
+ if ((m_level + levels) < sigmod()->rules()->maxLevel())
{
for (int i = 0; i < levels; ++i)
setLevel(m_level + 1);
}
}
-void Pokebattle::TeamMember::evolveInto(Pokescripting::SpeciesWrapper* newSpecies)
+void Sigbattle::TeamMember::evolveInto(Sigscript::SpeciesWrapper* newSpecies)
{
emit(evolveStart());
- int oldStats[Pokemod::ST_End_GSC] = {};
- int newStats[Pokemod::ST_End_GSC] = {};
- oldStats[Pokemod::ST_Attack] = statValue(Pokemod::ST_Attack);
- oldStats[Pokemod::ST_Defense] = statValue(Pokemod::ST_Defense);
- oldStats[Pokemod::ST_Speed] = statValue(Pokemod::ST_Speed);
- if (pokemod()->rules()->specialSplit())
+ int oldStats[Sigmod::ST_End_GSC] = {};
+ int newStats[Sigmod::ST_End_GSC] = {};
+ oldStats[Sigmod::ST_Attack] = statValue(Sigmod::ST_Attack);
+ oldStats[Sigmod::ST_Defense] = statValue(Sigmod::ST_Defense);
+ oldStats[Sigmod::ST_Speed] = statValue(Sigmod::ST_Speed);
+ if (sigmod()->rules()->specialSplit())
{
- oldStats[Pokemod::ST_SpecialAttack] = statValue(Pokemod::ST_SpecialAttack);
- oldStats[Pokemod::ST_SpecialDefense] = statValue(Pokemod::ST_SpecialDefense);
+ oldStats[Sigmod::ST_SpecialAttack] = statValue(Sigmod::ST_SpecialAttack);
+ oldStats[Sigmod::ST_SpecialDefense] = statValue(Sigmod::ST_SpecialDefense);
}
else
- oldStats[Pokemod::ST_Special] = statValue(Pokemod::ST_Special);
+ oldStats[Sigmod::ST_Special] = statValue(Sigmod::ST_Special);
setSpecies(newSpecies);
- newStats[Pokemod::ST_Attack] = statValue(Pokemod::ST_Attack);
- newStats[Pokemod::ST_Defense] = statValue(Pokemod::ST_Defense);
- newStats[Pokemod::ST_Speed] = statValue(Pokemod::ST_Speed);
- if (pokemod()->rules()->specialSplit())
+ newStats[Sigmod::ST_Attack] = statValue(Sigmod::ST_Attack);
+ newStats[Sigmod::ST_Defense] = statValue(Sigmod::ST_Defense);
+ newStats[Sigmod::ST_Speed] = statValue(Sigmod::ST_Speed);
+ if (sigmod()->rules()->specialSplit())
{
- newStats[Pokemod::ST_SpecialAttack] = statValue(Pokemod::ST_SpecialAttack);
- newStats[Pokemod::ST_SpecialDefense] = statValue(Pokemod::ST_SpecialDefense);
+ newStats[Sigmod::ST_SpecialAttack] = statValue(Sigmod::ST_SpecialAttack);
+ newStats[Sigmod::ST_SpecialDefense] = statValue(Sigmod::ST_SpecialDefense);
}
else
- newStats[Pokemod::ST_Special] = statValue(Pokemod::ST_Special);
- if (oldStats[Pokemod::ST_Attack] != newStats[Pokemod::ST_Attack])
- emit(statChanged(Pokemod::ST_Attack, newStats[Pokemod::ST_Attack]));
- if (oldStats[Pokemod::ST_Defense] != newStats[Pokemod::ST_Defense])
- emit(statChanged(Pokemod::ST_Defense, newStats[Pokemod::ST_Defense]));
- if (oldStats[Pokemod::ST_Speed] != newStats[Pokemod::ST_Speed])
- emit(statChanged(Pokemod::ST_Speed, newStats[Pokemod::ST_Speed]));
- if (pokemod()->rules()->specialSplit())
- {
- if (oldStats[Pokemod::ST_SpecialAttack] != newStats[Pokemod::ST_SpecialAttack])
- emit(statChanged(Pokemod::ST_SpecialAttack, newStats[Pokemod::ST_SpecialAttack]));
- if (oldStats[Pokemod::ST_SpecialDefense] != newStats[Pokemod::ST_SpecialDefense])
- emit(statChanged(Pokemod::ST_SpecialDefense, newStats[Pokemod::ST_SpecialDefense]));
+ newStats[Sigmod::ST_Special] = statValue(Sigmod::ST_Special);
+ if (oldStats[Sigmod::ST_Attack] != newStats[Sigmod::ST_Attack])
+ emit(statChanged(Sigmod::ST_Attack, newStats[Sigmod::ST_Attack]));
+ if (oldStats[Sigmod::ST_Defense] != newStats[Sigmod::ST_Defense])
+ emit(statChanged(Sigmod::ST_Defense, newStats[Sigmod::ST_Defense]));
+ if (oldStats[Sigmod::ST_Speed] != newStats[Sigmod::ST_Speed])
+ emit(statChanged(Sigmod::ST_Speed, newStats[Sigmod::ST_Speed]));
+ if (sigmod()->rules()->specialSplit())
+ {
+ if (oldStats[Sigmod::ST_SpecialAttack] != newStats[Sigmod::ST_SpecialAttack])
+ emit(statChanged(Sigmod::ST_SpecialAttack, newStats[Sigmod::ST_SpecialAttack]));
+ if (oldStats[Sigmod::ST_SpecialDefense] != newStats[Sigmod::ST_SpecialDefense])
+ emit(statChanged(Sigmod::ST_SpecialDefense, newStats[Sigmod::ST_SpecialDefense]));
}
else
{
- if (oldStats[Pokemod::ST_Special] != newStats[Pokemod::ST_Special])
- emit(statChanged(Pokemod::ST_Special, newStats[Pokemod::ST_Special]));
+ if (oldStats[Sigmod::ST_Special] != newStats[Sigmod::ST_Special])
+ emit(statChanged(Sigmod::ST_Special, newStats[Sigmod::ST_Special]));
}
emit(evolveEnd());
}
-void Pokebattle::TeamMember::setName(const QString& name)
+void Sigbattle::TeamMember::setName(const QString& name)
{
if (m_name != name)
{
@@ -372,7 +372,7 @@ void Pokebattle::TeamMember::setName(const QString& name)
}
}
-void Pokebattle::TeamMember::cureStatus(Pokescripting::StatusWrapper* status)
+void Sigbattle::TeamMember::cureStatus(Sigscript::StatusWrapper* status)
{
if (m_status.contains(status))
{
@@ -384,12 +384,12 @@ void Pokebattle::TeamMember::cureStatus(Pokescripting::StatusWrapper* status)
}
}
-void Pokebattle::TeamMember::giveStatus(Pokescripting::StatusWrapper* status)
+void Sigbattle::TeamMember::giveStatus(Sigscript::StatusWrapper* status)
{
- Q_ASSERT(pokemod()->statusIndex(status) != INT_MAX);
+ Q_ASSERT(sigmod()->statusIndex(status) != INT_MAX);
if (!m_status.contains(status))
{
- const Pokemod::Script script = status->worldScript();
+ const Sigmod::Script script = status->worldScript();
Kross::Action* statusAction = new Kross::Action(Kross::Manager::self().actionCollection()->collection("status"), QString("status-%1").arg(QUuid::createUuid().toString()));
statusAction->setInterpreter(script.interpreter());
statusAction->setCode(script.script().toUtf8());
@@ -400,9 +400,9 @@ void Pokebattle::TeamMember::giveStatus(Pokescripting::StatusWrapper* status)
}
}
-void Pokebattle::TeamMember::giveLevelExp(const int exp)
+void Sigbattle::TeamMember::giveLevelExp(const int exp)
{
- if (m_level == pokemod()->rules()->maxLevel())
+ if (m_level == sigmod()->rules()->maxLevel())
return;
const int expNeeded = calcExp(m_level + 1) - calcExp();
if (exp < expNeeded)
@@ -418,17 +418,17 @@ void Pokebattle::TeamMember::giveLevelExp(const int exp)
}
}
-void Pokebattle::TeamMember::giveStatExp(const Pokemod::Stat stat, const int exp)
+void Sigbattle::TeamMember::giveStatExp(const Sigmod::Stat stat, const int exp)
{
- Q_ASSERT(stat < (pokemod()->rules()->specialSplit() ? Pokemod::ST_End_GSC : Pokemod::ST_End_RBY));
+ Q_ASSERT(stat < (sigmod()->rules()->specialSplit() ? Sigmod::ST_End_GSC : Sigmod::ST_End_RBY));
const int oldStat = statValue(stat);
int expToGive = exp;
- if (pokemod()->rules()->effortValuesAllowed())
+ if (sigmod()->rules()->effortValuesAllowed())
{
int totalEV = 0;
- for (int i = 0; i < Pokemod::ST_End_GSC; ++i)
+ for (int i = 0; i < Sigmod::ST_End_GSC; ++i)
totalEV += m_statExp[i];
- while (expToGive && (totalEV < pokemod()->rules()->maxTotalEV()) && (m_statExp[stat] < pokemod()->rules()->maxEVPerStat()))
+ while (expToGive && (totalEV < sigmod()->rules()->maxTotalEV()) && (m_statExp[stat] < sigmod()->rules()->maxEVPerStat()))
{
--expToGive;
++totalEV;
@@ -448,7 +448,7 @@ void Pokebattle::TeamMember::giveStatExp(const Pokemod::Stat stat, const int exp
emit(statChanged(stat, newStat));
}
-void Pokebattle::TeamMember::takeItem(Pokescripting::ItemWrapper* item)
+void Sigbattle::TeamMember::takeItem(Sigscript::ItemWrapper* item)
{
if (m_items.contains(item))
{
@@ -457,16 +457,16 @@ void Pokebattle::TeamMember::takeItem(Pokescripting::ItemWrapper* item)
}
}
-void Pokebattle::TeamMember::giveItem(Pokescripting::ItemWrapper* item)
+void Sigbattle::TeamMember::giveItem(Sigscript::ItemWrapper* item)
{
- if (m_items.size() < pokemod()->rules()->maxHeldItems())
+ if (m_items.size() < sigmod()->rules()->maxHeldItems())
{
m_items.append(item);
emit(itemGiven(item));
}
}
-void Pokebattle::TeamMember::forgetMove(Pokescripting::MoveWrapper* move)
+void Sigbattle::TeamMember::forgetMove(Sigscript::MoveWrapper* move)
{
if (m_moves.contains(move))
{
@@ -475,11 +475,11 @@ void Pokebattle::TeamMember::forgetMove(Pokescripting::MoveWrapper* move)
}
}
-void Pokebattle::TeamMember::teachMove(Pokescripting::MoveWrapper* move)
+void Sigbattle::TeamMember::teachMove(Sigscript::MoveWrapper* move)
{
if (canLearnMove(move))
{
- if (m_moves.size() < pokemod()->rules()->maxMoves())
+ if (m_moves.size() < sigmod()->rules()->maxMoves())
{
m_moves.append(move);
emit(moveLearned(move));
@@ -489,7 +489,7 @@ void Pokebattle::TeamMember::teachMove(Pokescripting::MoveWrapper* move)
emit(unlearnableMove(move));
}
-Pokebattle::TeamMember::Action Pokebattle::TeamMember::requestAction() const
+Sigbattle::TeamMember::Action Sigbattle::TeamMember::requestAction() const
{
Player* player = qobject_cast<Player*>(m_containment);
if (player)
@@ -497,12 +497,12 @@ Pokebattle::TeamMember::Action Pokebattle::TeamMember::requestAction() const
return Action(Invalid, ActionData());
}
-void Pokebattle::TeamMember::makeActive(Arena* arena)
+void Sigbattle::TeamMember::makeActive(Arena* arena)
{
- QList<Pokescripting::StatusWrapper*> statuses = m_status.uniqueKeys();
- foreach (Pokescripting::StatusWrapper* status, statuses)
+ QList<Sigscript::StatusWrapper*> statuses = m_status.uniqueKeys();
+ foreach (Sigscript::StatusWrapper* status, statuses)
{
- const Pokemod::Script script = status->battleScript();
+ const Sigmod::Script script = status->battleScript();
Kross::Action* statusScript = new Kross::Action(Kross::Manager::self().actionCollection()->collection("status"), QString("status-%1").arg(QUuid::createUuid().toString()));
statusScript->setInterpreter(script.interpreter());
statusScript->setCode(script.script().toUtf8());
@@ -511,10 +511,10 @@ void Pokebattle::TeamMember::makeActive(Arena* arena)
statusScript->trigger();
m_statusBattleScripts.append(statusScript);
}
- QList<Pokescripting::AbilityWrapper*> abilities = m_abilities.keys();
- foreach (Pokescripting::AbilityWrapper* ability, abilities)
+ QList<Sigscript::AbilityWrapper*> abilities = m_abilities.keys();
+ foreach (Sigscript::AbilityWrapper* ability, abilities)
{
- const Pokemod::Script script = ability->battleScript();
+ const Sigmod::Script script = ability->battleScript();
Kross::Action* abilityScript = new Kross::Action(Kross::Manager::self().actionCollection()->collection("ability"), QString("ability-%1").arg(QUuid::createUuid().toString()));
abilityScript->setInterpreter(script.interpreter());
abilityScript->setCode(script.script().toUtf8());
@@ -525,23 +525,23 @@ void Pokebattle::TeamMember::makeActive(Arena* arena)
}
}
-void Pokebattle::TeamMember::writeBack()
+void Sigbattle::TeamMember::writeBack()
{
// TODO: write back all (applicable) differences between config and local storage
}
-Pokescripting::PokemodWrapper* Pokebattle::TeamMember::pokemod() const
+Sigscript::SigmodWrapper* Sigbattle::TeamMember::sigmod() const
{
- return m_containment->pokemod();
+ return m_containment->sigmod();
}
-void Pokebattle::TeamMember::setSpecies(Pokescripting::SpeciesWrapper* species)
+void Sigbattle::TeamMember::setSpecies(Sigscript::SpeciesWrapper* species)
{
m_species = species;
emit(speciesChanged(m_species));
}
-void Pokebattle::TeamMember::setLevel(const int level)
+void Sigbattle::TeamMember::setLevel(const int level)
{
emit(levelAboutToGrow());
m_level = level;
@@ -549,24 +549,24 @@ void Pokebattle::TeamMember::setLevel(const int level)
m_levelExp = calcExp();
}
-void Pokebattle::TeamMember::levelGrown()
+void Sigbattle::TeamMember::levelGrown()
{
for (int i = 0; i < m_species->moveCount(); ++i)
{
- Pokescripting::SpeciesMoveWrapper* move = m_species->move(i);
+ Sigscript::SpeciesMoveWrapper* move = m_species->move(i);
if (move->level() == m_level)
teachMove(move->move());
}
}
-void Pokebattle::TeamMember::makeConnections()
+void Sigbattle::TeamMember::makeConnections()
{
// TODO: make connections that are necessary (watching Config changes mainly)
}
-void Pokebattle::TeamMember::initAbility(Pokescripting::AbilityWrapper* ability)
+void Sigbattle::TeamMember::initAbility(Sigscript::AbilityWrapper* ability)
{
- const Pokemod::Script script = ability->battleScript();
+ const Sigmod::Script script = ability->battleScript();
Kross::Action* abilityScript = new Kross::Action(Kross::Manager::self().actionCollection()->collection("ability"), QString("ability-%1").arg(QUuid::createUuid().toString()));
abilityScript->setInterpreter(script.interpreter());
abilityScript->setCode(script.script().toUtf8());
@@ -575,63 +575,63 @@ void Pokebattle::TeamMember::initAbility(Pokescripting::AbilityWrapper* ability)
m_abilities[ability] = abilityScript;
}
-void Pokebattle::TeamMember::initItems()
+void Sigbattle::TeamMember::initItems()
{
- Pokemod::Hat<Pokescripting::ItemWrapper*> hat = m_species->itemHat();
- for (int i = 0; i < pokemod()->rules()->maxHeldItems(); ++i)
+ Sigmod::Hat<Sigscript::ItemWrapper*> hat = m_species->itemHat();
+ for (int i = 0; i < sigmod()->rules()->maxHeldItems(); ++i)
{
if (m_species->itemChance().poll())
m_items.append(hat.pick());
}
}
-void Pokebattle::TeamMember::initAbilities(const QList<Pokescripting::AbilityWrapper*>& initial)
+void Sigbattle::TeamMember::initAbilities(const QList<Sigscript::AbilityWrapper*>& initial)
{
- foreach (Pokescripting::AbilityWrapper* ability, initial)
+ foreach (Sigscript::AbilityWrapper* ability, initial)
initAbility(ability);
- Pokemod::Hat<Pokescripting::AbilityWrapper*> hat = m_species->abilityHat();
- while (m_abilities.size() < pokemod()->rules()->maxAbilities())
+ Sigmod::Hat<Sigscript::AbilityWrapper*> hat = m_species->abilityHat();
+ while (m_abilities.size() < sigmod()->rules()->maxAbilities())
{
- Pokescripting::AbilityWrapper* ability = hat.takeAndClear();
+ Sigscript::AbilityWrapper* ability = hat.takeAndClear();
if (!m_abilities.contains(ability))
initAbility(ability);
}
}
-void Pokebattle::TeamMember::initMoves(const QList<Pokescripting::MoveWrapper*>& initial)
+void Sigbattle::TeamMember::initMoves(const QList<Sigscript::MoveWrapper*>& initial)
{
m_moves = initial;
- for (int i = 0; (i < m_species->moveCount()) && (m_moves.size() < pokemod()->rules()->maxMoves()); ++i)
+ for (int i = 0; (i < m_species->moveCount()) && (m_moves.size() < sigmod()->rules()->maxMoves()); ++i)
{
- Pokescripting::SpeciesMoveWrapper* move = m_species->move(i);
+ Sigscript::SpeciesMoveWrapper* move = m_species->move(i);
if (!m_moves.contains(move->move()) && (((move->level() < m_level) && move->level()) || (!m_containment->isMutable() && (move->wild() < m_level))))
m_moves.append(move->move());
}
}
-void Pokebattle::TeamMember::initNatures(const QList<Pokescripting::NatureWrapper*>& initial)
+void Sigbattle::TeamMember::initNatures(const QList<Sigscript::NatureWrapper*>& initial)
{
m_natures = initial;
- Pokemod::Hat<Pokescripting::NatureWrapper*> hat = pokemod()->natureHat();
- while (m_natures.size() < pokemod()->rules()->maxNatures())
+ Sigmod::Hat<Sigscript::NatureWrapper*> hat = sigmod()->natureHat();
+ while (m_natures.size() < sigmod()->rules()->maxNatures())
{
- Pokescripting::NatureWrapper* nature = hat.takeAndClear();
+ Sigscript::NatureWrapper* nature = hat.takeAndClear();
if (!m_natures.contains(nature))
m_natures.append(nature);
}
}
-void Pokebattle::TeamMember::initStats()
+void Sigbattle::TeamMember::initStats()
{
- if (pokemod()->rules()->specialDVSplit())
+ if (sigmod()->rules()->specialDVSplit())
{
- for (int i = 0; i < Pokemod::ST_End_GSC; ++i)
+ for (int i = 0; i < Sigmod::ST_End_GSC; ++i)
m_dv[i] = qrand() & 31;
}
else
{
- for (int i = Pokemod::ST_No_HP_Start; i < Pokemod::ST_End_RBY; ++i)
+ for (int i = Sigmod::ST_No_HP_Start; i < Sigmod::ST_End_RBY; ++i)
m_dv[i] = qrand() & 15;
- m_dv[Pokemod::ST_HP] = ((m_dv[Pokemod::ST_Attack] & 1) << 3) + ((m_dv[Pokemod::ST_Defense] & 1) << 2) + ((m_dv[Pokemod::ST_Speed] & 1) << 1) + (m_dv[Pokemod::ST_Special] & 1);
+ m_dv[Sigmod::ST_HP] = ((m_dv[Sigmod::ST_Attack] & 1) << 3) + ((m_dv[Sigmod::ST_Defense] & 1) << 2) + ((m_dv[Sigmod::ST_Speed] & 1) << 1) + (m_dv[Sigmod::ST_Special] & 1);
}
}
diff --git a/sigbattle/TeamMember.h b/sigbattle/TeamMember.h
index db61571a..84e441d0 100644
--- a/sigbattle/TeamMember.h
+++ b/sigbattle/TeamMember.h
@@ -15,17 +15,17 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef __POKEBATTLE_TEAMMEMBER__
-#define __POKEBATTLE_TEAMMEMBER__
+#ifndef __SIGBATTLE_TEAMMEMBER__
+#define __SIGBATTLE_TEAMMEMBER__
-// Pokebattle includes
+// Sigbattle includes
#include "Global.h"
-// Pokescripting includes
-#include "../pokescripting/Config.h"
+// Sigscript includes
+#include "../sigscript/Config.h"
-// Pokemod includes
-#include "../pokemod/Global.h"
+// Sigmod includes
+#include "../sigmod/Global.h"
// Qt includes
#include <QtCore/QFuture>
@@ -38,14 +38,14 @@
#include <QtCore/QUuid>
// Forward declarations
-namespace Pokescripting
+namespace Sigscript
{
class AbilityWrapper;
class ItemWrapper;
class MoveWrapper;
class NatureWrapper;
class MapTrainerTeamMemberWrapper;
-class PokemodWrapper;
+class SigmodWrapper;
class SpeciesWrapper;
class StatusWrapper;
}
@@ -54,12 +54,12 @@ namespace Kross
class Action;
}
-namespace Pokebattle
+namespace Sigbattle
{
class Arena;
class Containment;
-class POKEBATTLE_EXPORT TeamMember : public Pokescripting::Config
+class SIGBATTLE_EXPORT TeamMember : public Sigscript::Config
{
Q_OBJECT
@@ -88,67 +88,67 @@ class POKEBATTLE_EXPORT TeamMember : public Pokescripting::Config
typedef QPair<TeamMember*, QFuture<TeamMember::Action> > RequestedAction;
TeamMember(const int speciesId, const QString& name, const int level, Containment* containment, const bool suppressItems = false);
- TeamMember(Pokescripting::MapTrainerTeamMemberWrapper* teamMember, Containment* containment);
+ TeamMember(Sigscript::MapTrainerTeamMemberWrapper* teamMember, Containment* containment);
QUuid id() const;
QString name() const;
long long currentHp() const;
- Pokescripting::SpeciesWrapper* species() const;
+ Sigscript::SpeciesWrapper* species() const;
int level() const;
Gender gender() const;
long long levelExperience() const;
- int baseStat(const Pokemod::Stat stat) const;
- long long statExperience(const Pokemod::Stat stat) const;
- int dv(const Pokemod::Stat stat) const;
- long long statValue(const Pokemod::Stat stat, const long long exp = -1) const;
+ int baseStat(const Sigmod::Stat stat) const;
+ long long statExperience(const Sigmod::Stat stat) const;
+ int dv(const Sigmod::Stat stat) const;
+ long long statValue(const Sigmod::Stat stat, const long long exp = -1) const;
long long calcExp(int level = -1) const;
- bool canLearnMove(Pokescripting::MoveWrapper* move) const;
+ bool canLearnMove(Sigscript::MoveWrapper* move) const;
- Pokescripting::PokemodWrapper* pokemod() const;
+ Sigscript::SigmodWrapper* sigmod() const;
signals:
- void speciesChanged(Pokescripting::SpeciesWrapper* species);
+ void speciesChanged(Sigscript::SpeciesWrapper* species);
void evolveStart();
void evolveEnd();
void nameChanged(const QString& oldName, const QString& newName);
- void statusCured(Pokescripting::StatusWrapper* status);
- void statusInflicted(Pokescripting::StatusWrapper* status);
+ void statusCured(Sigscript::StatusWrapper* status);
+ void statusInflicted(Sigscript::StatusWrapper* status);
void expGained(const int exp);
void levelAboutToGrow();
void levelGrown(const int newLevel);
- void statChanged(const Pokemod::Stat stat, const int value);
+ void statChanged(const Sigmod::Stat stat, const int value);
void effortFull(const int stat);
void totalEffortFull();
- void itemTaken(Pokescripting::ItemWrapper* item);
- void itemGiven(Pokescripting::ItemWrapper* item);
+ void itemTaken(Sigscript::ItemWrapper* item);
+ void itemGiven(Sigscript::ItemWrapper* item);
- void moveForgotten(Pokescripting::MoveWrapper* move);
- void moveLearned(Pokescripting::MoveWrapper* move);
- void movesFull(Pokescripting::MoveWrapper* move);
- void unlearnableMove(Pokescripting::MoveWrapper* move);
+ void moveForgotten(Sigscript::MoveWrapper* move);
+ void moveLearned(Sigscript::MoveWrapper* move);
+ void movesFull(Sigscript::MoveWrapper* move);
+ void unlearnableMove(Sigscript::MoveWrapper* move);
void knockedOut();
public slots:
void boostLevels(const int levels);
- void evolveInto(Pokescripting::SpeciesWrapper* newSpecies);
+ void evolveInto(Sigscript::SpeciesWrapper* newSpecies);
void setName(const QString& name);
- void cureStatus(Pokescripting::StatusWrapper* status);
- void giveStatus(Pokescripting::StatusWrapper* status);
+ void cureStatus(Sigscript::StatusWrapper* status);
+ void giveStatus(Sigscript::StatusWrapper* status);
void giveLevelExp(const int exp);
- void giveStatExp(const Pokemod::Stat stat, const int exp);
- void takeItem(Pokescripting::ItemWrapper* item);
- void giveItem(Pokescripting::ItemWrapper* item);
- void forgetMove(Pokescripting::MoveWrapper* move);
- void teachMove(Pokescripting::MoveWrapper* move);
+ void giveStatExp(const Sigmod::Stat stat, const int exp);
+ void takeItem(Sigscript::ItemWrapper* item);
+ void giveItem(Sigscript::ItemWrapper* item);
+ void forgetMove(Sigscript::MoveWrapper* move);
+ void teachMove(Sigscript::MoveWrapper* move);
Action requestAction() const;
@@ -156,7 +156,7 @@ class POKEBATTLE_EXPORT TeamMember : public Pokescripting::Config
virtual void writeBack();
protected slots:
- void setSpecies(Pokescripting::SpeciesWrapper* species);
+ void setSpecies(Sigscript::SpeciesWrapper* species);
void setLevel(const int level);
private slots:
void levelGrown();
@@ -167,41 +167,41 @@ class POKEBATTLE_EXPORT TeamMember : public Pokescripting::Config
QString m_name;
long long m_currentHp;
- Pokescripting::SpeciesWrapper* m_species;
+ Sigscript::SpeciesWrapper* m_species;
Gender m_gender;
long long m_levelExp;
int m_level;
- long long m_statExp[Pokemod::ST_End_GSC];
- int m_dv[Pokemod::ST_End_GSC];
- QMultiMap<Pokescripting::StatusWrapper*, Kross::Action*> m_status;
- QMap<Pokescripting::AbilityWrapper*, Kross::Action*> m_abilities;
- QList<Pokescripting::ItemWrapper*> m_items;
- QList<Pokescripting::MoveWrapper*> m_moves;
- QList<Pokescripting::NatureWrapper*> m_natures;
+ long long m_statExp[Sigmod::ST_End_GSC];
+ int m_dv[Sigmod::ST_End_GSC];
+ QMultiMap<Sigscript::StatusWrapper*, Kross::Action*> m_status;
+ QMap<Sigscript::AbilityWrapper*, Kross::Action*> m_abilities;
+ QList<Sigscript::ItemWrapper*> m_items;
+ QList<Sigscript::MoveWrapper*> m_moves;
+ QList<Sigscript::NatureWrapper*> m_natures;
QList<Kross::Action*> m_abilityBattleScripts;
QList<Kross::Action*> m_statusBattleScripts;
private:
void makeConnections();
- void initAbility(Pokescripting::AbilityWrapper* ability);
+ void initAbility(Sigscript::AbilityWrapper* ability);
void initItems();
- void initAbilities(const QList<Pokescripting::AbilityWrapper*>& initial = QList<Pokescripting::AbilityWrapper*>());
- void initMoves(const QList<Pokescripting::MoveWrapper*>& initial = QList<Pokescripting::MoveWrapper*>());
- void initNatures(const QList<Pokescripting::NatureWrapper*>& initial = QList<Pokescripting::NatureWrapper*>());
+ void initAbilities(const QList<Sigscript::AbilityWrapper*>& initial = QList<Sigscript::AbilityWrapper*>());
+ void initMoves(const QList<Sigscript::MoveWrapper*>& initial = QList<Sigscript::MoveWrapper*>());
+ void initNatures(const QList<Sigscript::NatureWrapper*>& initial = QList<Sigscript::NatureWrapper*>());
void initStats();
};
int actionPriority(const TeamMember* teamMember, const TeamMember::Action& action);
}
-Q_DECLARE_METATYPE(Pokebattle::TeamMember*)
-Q_DECLARE_METATYPE(Pokebattle::TeamMember::Gender)
-Q_DECLARE_METATYPE(Pokebattle::TeamMember::ActionType)
-Q_DECLARE_METATYPE(Pokebattle::TeamMember::Targets)
-Q_DECLARE_METATYPE(Pokebattle::TeamMember::ActionData)
-Q_DECLARE_METATYPE(Pokebattle::TeamMember::Action)
-Q_DECLARE_METATYPE(Pokebattle::TeamMember::RequestedAction)
+Q_DECLARE_METATYPE(Sigbattle::TeamMember*)
+Q_DECLARE_METATYPE(Sigbattle::TeamMember::Gender)
+Q_DECLARE_METATYPE(Sigbattle::TeamMember::ActionType)
+Q_DECLARE_METATYPE(Sigbattle::TeamMember::Targets)
+Q_DECLARE_METATYPE(Sigbattle::TeamMember::ActionData)
+Q_DECLARE_METATYPE(Sigbattle::TeamMember::Action)
+Q_DECLARE_METATYPE(Sigbattle::TeamMember::RequestedAction)
#endif
diff --git a/sigbattle/TurnArena.cpp b/sigbattle/TurnArena.cpp
index bf0bece8..a42af480 100644
--- a/sigbattle/TurnArena.cpp
+++ b/sigbattle/TurnArena.cpp
@@ -18,8 +18,8 @@
// Header include
#include "TurnArena.h"
-// Pokemod includes
-#include "../pokemod/Fraction.h"
+// Sigmod includes
+#include "../sigmod/Fraction.h"
// Qt includes
#include <QtAlgorithms>
@@ -27,7 +27,7 @@
#include <QtCore/QFuture>
#include <QtCore/QTimer>
-bool Pokebattle::sortActions(const TeamMember::RequestedAction& reqAction1, const TeamMember::RequestedAction& reqAction2)
+bool Sigbattle::sortActions(const TeamMember::RequestedAction& reqAction1, const TeamMember::RequestedAction& reqAction2)
{
TeamMember::Action action1 = reqAction1.second.isFinished() ? reqAction1.second : TeamMember::Action(TeamMember::Timeout, TeamMember::ActionData());
TeamMember::Action action2 = reqAction2.second.isFinished() ? reqAction2.second : TeamMember::Action(TeamMember::Timeout, TeamMember::ActionData());
@@ -37,17 +37,17 @@ bool Pokebattle::sortActions(const TeamMember::RequestedAction& reqAction1, cons
return true;
else if (priority1 == priority2)
{
- const int speed1 = reqAction1.first->statValue(Pokemod::ST_Speed);
- const int speed2 = reqAction2.first->statValue(Pokemod::ST_Speed);
+ const int speed1 = reqAction1.first->statValue(Sigmod::ST_Speed);
+ const int speed2 = reqAction2.first->statValue(Sigmod::ST_Speed);
if (speed1 < speed2)
return true;
else if (speed1 == speed2)
- return Pokemod::Fraction(1, 2).poll();
+ return Sigmod::Fraction(1, 2).poll();
}
return false;
}
-Pokebattle::TurnArena::TurnArena(QList<Player*> players, QObject* parent) :
+Sigbattle::TurnArena::TurnArena(QList<Player*> players, QObject* parent) :
Arena(players, parent),
m_watcher(new QFutureWatcher<TeamMember::RequestedAction>(this)),
m_timer(new QTimer(this))
@@ -57,11 +57,11 @@ Pokebattle::TurnArena::TurnArena(QList<Player*> players, QObject* parent) :
connect(m_timer, SIGNAL(timeout()), m_watcher, SLOT(cancel()));
}
-void Pokebattle::TurnArena::processRound()
+void Sigbattle::TurnArena::processRound()
{
emit(roundAboutToStart());
emit(roundStart());
- QFuture<TeamMember::RequestedAction> reqActions = QtConcurrent::mapped(active(), &Pokebattle::requestDecision);
+ QFuture<TeamMember::RequestedAction> reqActions = QtConcurrent::mapped(active(), &Sigbattle::requestDecision);
m_watcher->setFuture(reqActions);
m_timer->start(120000);
reqActions.waitForFinished();
@@ -94,7 +94,7 @@ void Pokebattle::TurnArena::processRound()
processRound();
}
-void Pokebattle::TurnArena::setupBattle()
+void Sigbattle::TurnArena::setupBattle()
{
// TODO: setup everything for the arena to do with the turns
Arena::setupBattle();
diff --git a/sigbattle/TurnArena.h b/sigbattle/TurnArena.h
index 636ae501..2a3b2864 100644
--- a/sigbattle/TurnArena.h
+++ b/sigbattle/TurnArena.h
@@ -15,10 +15,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef __POKEBATTLE_TURNARENA__
-#define __POKEBATTLE_TURNARENA__
+#ifndef __SIGBATTLE_TURNARENA__
+#define __SIGBATTLE_TURNARENA__
-// Pokebattle includes
+// Sigbattle includes
#include "Arena.h"
#include "TeamMember.h"
@@ -28,9 +28,9 @@
// Forward declarations
class QTimer;
-namespace Pokebattle
+namespace Sigbattle
{
-class POKEBATTLE_EXPORT TurnArena : public Arena
+class SIGBATTLE_EXPORT TurnArena : public Arena
{
Q_OBJECT
@@ -54,6 +54,6 @@ class POKEBATTLE_EXPORT TurnArena : public Arena
bool sortActions(const TeamMember::RequestedAction& reqAction1, const TeamMember::RequestedAction& reqAction2);
}
-Q_DECLARE_METATYPE(Pokebattle::TurnArena*)
+Q_DECLARE_METATYPE(Sigbattle::TurnArena*)
#endif