summaryrefslogtreecommitdiffstats
path: root/examples/statemachine/errorstate/tankitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/statemachine/errorstate/tankitem.cpp')
-rw-r--r--examples/statemachine/errorstate/tankitem.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/examples/statemachine/errorstate/tankitem.cpp b/examples/statemachine/errorstate/tankitem.cpp
index ae338fe..1e02171 100644
--- a/examples/statemachine/errorstate/tankitem.cpp
+++ b/examples/statemachine/errorstate/tankitem.cpp
@@ -141,6 +141,11 @@ void TankItem::turn(qreal degrees)
setAction(new TurnAction(this, degrees));
}
+void TankItem::turnTo(qreal degrees)
+{
+ setAction(new TurnAction(this, degrees - direction()));
+}
+
void TankItem::stop()
{
setAction(0);