summaryrefslogtreecommitdiffstats
path: root/examples/statemachine
diff options
context:
space:
mode:
Diffstat (limited to 'examples/statemachine')
-rw-r--r--examples/statemachine/tankgameplugins/seek_ai/seek_ai.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/statemachine/tankgameplugins/seek_ai/seek_ai.h b/examples/statemachine/tankgameplugins/seek_ai/seek_ai.h
index 2835988..597f8595 100644
--- a/examples/statemachine/tankgameplugins/seek_ai/seek_ai.h
+++ b/examples/statemachine/tankgameplugins/seek_ai/seek_ai.h
@@ -137,16 +137,20 @@ public:
ChaseState(QObject *tank, QState *parentState = 0) : QState(parentState), m_tank(tank)
{
QState *fireCannon = new QState(this);
+ fireCannon->setObjectName("fireCannon");
connect(fireCannon, SIGNAL(entered()), tank, SLOT(fireCannon()));
setInitialState(fireCannon);
- m_goToLocation = new GoToLocationState(this);
+ m_goToLocation = new GoToLocationState(tank, this);
+ m_goToLocation->setObjectName("goToLocation");
fireCannon->addTransition(tank, SIGNAL(actionCompleted()), m_goToLocation);
m_turnToDirection = new QState(this);
+ m_turnToDirection->setObjectName("turnToDirection");
m_goToLocation->addTransition(tank, SIGNAL(actionCompleted()), m_turnToDirection);
QFinalState *finalState = new QFinalState(this);
+ finalState->setObjectName("finalState");
m_turnToDirection->addTransition(tank, SIGNAL(actionCompleted()), finalState);
}