From f2ce49ee898928a954a84dff605dc2be2b054fdb Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 17 Mar 2009 23:24:57 -0400 Subject: Connect the signal mapper up --- sigencore/plugins/arenas/atb/ATBTimer.cpp | 9 +++++++++ sigencore/plugins/arenas/atb/ATBTimer.h | 1 + 2 files changed, 10 insertions(+) (limited to 'sigencore/plugins') diff --git a/sigencore/plugins/arenas/atb/ATBTimer.cpp b/sigencore/plugins/arenas/atb/ATBTimer.cpp index 6f32d312..adb2a853 100644 --- a/sigencore/plugins/arenas/atb/ATBTimer.cpp +++ b/sigencore/plugins/arenas/atb/ATBTimer.cpp @@ -72,8 +72,10 @@ struct ATBTimer::TimerIncrementFunctor ATBTimer::ATBTimer(ATBArena* arena, ActionMap& actions) : QThread(arena), m_arena(arena), + m_actionMapper(new QSignalMapper(this)), m_actions(actions) { + connect(m_actionMapper, SIGNAL(mapped(QObject*)), this, SLOT(actionReceived(QObject*))); } ATBTimer::~ATBTimer() @@ -92,3 +94,10 @@ void ATBTimer::timerEvent(QTimerEvent* event) const QList active = m_arena->active(Arena::Fighters); QtConcurrent::blockingFiltered(active, TimerIncrementFunctor(this)); } + +void ATBTimer::actionReceived(QObject* object) +{ + TeamMember* teamMember = qobject_cast(object); + if (teamMember) + emit(actionReady(teamMember)); +} diff --git a/sigencore/plugins/arenas/atb/ATBTimer.h b/sigencore/plugins/arenas/atb/ATBTimer.h index 61cbe5a1..113d7669 100644 --- a/sigencore/plugins/arenas/atb/ATBTimer.h +++ b/sigencore/plugins/arenas/atb/ATBTimer.h @@ -45,6 +45,7 @@ class ATBTimer : public QThread void timerEvent(QTimerEvent* event); protected slots: + void actionReceived(QObject* object); private: struct TimerIncrementFunctor; -- cgit