summaryrefslogtreecommitdiffstats
path: root/pokebattle/TurnArena.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-07-20 22:30:54 +0000
committerBen Boeckel <MathStuf@gmail.com>2008-07-20 22:30:54 +0000
commit96058e330b9a535ec3aecc40cfbd2fa74b791cd8 (patch)
tree5afa3a01da6345b4f173e9578e0f7b0219cb9759 /pokebattle/TurnArena.cpp
parenta44d3c2ebd20e05c7c574cd3a13888fc471067b9 (diff)
downloadsigen-96058e330b9a535ec3aecc40cfbd2fa74b791cd8.tar.gz
sigen-96058e330b9a535ec3aecc40cfbd2fa74b791cd8.tar.xz
sigen-96058e330b9a535ec3aecc40cfbd2fa74b791cd8.zip
[FIX] Slimmed up main() for pokemodr
[FIX] Cleaned up initializing TeamMember [FIX] Hat fixed up [ADD] Added ActionQueue (thread-safe QQueue) [FIX] Arena classes fleshed out a bit [ADD] ATBTimer class added to mediate the ATB counters git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@228 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokebattle/TurnArena.cpp')
-rw-r--r--pokebattle/TurnArena.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/pokebattle/TurnArena.cpp b/pokebattle/TurnArena.cpp
index 2ec6eb55..a0ea2735 100644
--- a/pokebattle/TurnArena.cpp
+++ b/pokebattle/TurnArena.cpp
@@ -18,9 +18,31 @@
// Header include
#include "TurnArena.h"
+// Qt includes
+#include <QtCore/QtConcurrentMap>
+
Pokebattle::TurnArena::TurnArena(QList<Player*> players) :
Arena(players)
{
- emit(battleStart());
+ connect(this, SIGNAL(roundStart()), SLOT(processRound()));
+ setupBattle();
+}
+
+void Pokebattle::TurnArena::processRound()
+{
+// QFuture<TeamMember::Action> actions = QtConcurrent::mapped(m_players, requestDecision);
+ // TODO: timeout here?
+ // TODO: determine the (preliminary) order of attacks
+ // TODO: wait for all actions (unless timeout)
+ // TODO: get order again
+ // TODO: act out actions (ignoring those that faint along the way)
+ emit(roundEnd());
+ // TODO: If only one player left, battle is over
+ // TODO: restart round again
}
+void Pokebattle::TurnArena::setupBattle()
+{
+ // TODO: setup everything for the arena to do with the turns
+ Arena::setupBattle();
+}