From ed1ce517473b2b3a23e26819ea42e535c932e378 Mon Sep 17 00:00:00 2001 From: ngaud Date: Tue, 2 May 2017 17:34:19 +0200 Subject: [PATCH] rewriting task cancelling --- src/main/sarl/io/sarl/demos/fireworks/Positions.sarl | 1 + src/main/sarl/io/sarl/demos/fireworks/agents/Fire.sarl | 4 ++-- src/main/sarl/io/sarl/demos/fireworks/agents/Rocket.sarl | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/sarl/io/sarl/demos/fireworks/Positions.sarl b/src/main/sarl/io/sarl/demos/fireworks/Positions.sarl index 76555d8..f6f1798 100644 --- a/src/main/sarl/io/sarl/demos/fireworks/Positions.sarl +++ b/src/main/sarl/io/sarl/demos/fireworks/Positions.sarl @@ -9,6 +9,7 @@ import javafx.scene.paint.Color class RocketsPos { public val ROCKETREFRESHDELAY = 100 + var position = new Vector() var color : Color var hidden = false diff --git a/src/main/sarl/io/sarl/demos/fireworks/agents/Fire.sarl b/src/main/sarl/io/sarl/demos/fireworks/agents/Fire.sarl index 722c0f3..daa2ca8 100644 --- a/src/main/sarl/io/sarl/demos/fireworks/agents/Fire.sarl +++ b/src/main/sarl/io/sarl/demos/fireworks/agents/Fire.sarl @@ -38,7 +38,7 @@ agent Fire { on Freeze { this.frozen = occurrence.value if (frozen) - cancel(move, true) + move.cancel(true) else wake(new UpdateFirePosition) } @@ -106,7 +106,7 @@ agent Fire { } def cleanBeforeExit() { - cancel(move, true) + move.cancel(true) exited = true destroyed = true } diff --git a/src/main/sarl/io/sarl/demos/fireworks/agents/Rocket.sarl b/src/main/sarl/io/sarl/demos/fireworks/agents/Rocket.sarl index feee963..b167b8f 100644 --- a/src/main/sarl/io/sarl/demos/fireworks/agents/Rocket.sarl +++ b/src/main/sarl/io/sarl/demos/fireworks/agents/Rocket.sarl @@ -47,7 +47,7 @@ agent Rocket { exploded = true frozen = true exited = true - cancel(move, true) + move.cancel(true) innerContext.defaultSpace.emit(new Exit) } @@ -55,7 +55,7 @@ agent Rocket { on Freeze { this.frozen = occurrence.value if (frozen) - cancel(move, true) + move.cancel(true) if (!frozen) wake(new UpdateRocketPosition) } @@ -98,7 +98,7 @@ agent Rocket { grid.setRocketPosition(id, vect) if (lifetime <= 0) { exploded = true - cancel(move, true) + move.cancel(true) grid.hideHocketPosition(id) wake(new Explode) }