1
0
mirror of https://github.com/klmp200/sarl-fireworks.git synced 2024-11-25 02:24:28 +00:00

rewriting task cancelling

This commit is contained in:
ngaud 2017-05-02 17:34:19 +02:00
parent 9316a74f07
commit ed1ce51747
3 changed files with 6 additions and 5 deletions

View File

@ -9,6 +9,7 @@ import javafx.scene.paint.Color
class RocketsPos { class RocketsPos {
public val ROCKETREFRESHDELAY = 100 public val ROCKETREFRESHDELAY = 100
var position = new Vector<Double>() var position = new Vector<Double>()
var color : Color var color : Color
var hidden = false var hidden = false

View File

@ -38,7 +38,7 @@ agent Fire {
on Freeze { on Freeze {
this.frozen = occurrence.value this.frozen = occurrence.value
if (frozen) if (frozen)
cancel(move, true) move.cancel(true)
else else
wake(new UpdateFirePosition) wake(new UpdateFirePosition)
} }
@ -106,7 +106,7 @@ agent Fire {
} }
def cleanBeforeExit() { def cleanBeforeExit() {
cancel(move, true) move.cancel(true)
exited = true exited = true
destroyed = true destroyed = true
} }

View File

@ -47,7 +47,7 @@ agent Rocket {
exploded = true exploded = true
frozen = true frozen = true
exited = true exited = true
cancel(move, true) move.cancel(true)
innerContext.defaultSpace.emit(new Exit) innerContext.defaultSpace.emit(new Exit)
} }
@ -55,7 +55,7 @@ agent Rocket {
on Freeze { on Freeze {
this.frozen = occurrence.value this.frozen = occurrence.value
if (frozen) if (frozen)
cancel(move, true) move.cancel(true)
if (!frozen) if (!frozen)
wake(new UpdateRocketPosition) wake(new UpdateRocketPosition)
} }
@ -98,7 +98,7 @@ agent Rocket {
grid.setRocketPosition(id, vect) grid.setRocketPosition(id, vect)
if (lifetime <= 0) { if (lifetime <= 0) {
exploded = true exploded = true
cancel(move, true) move.cancel(true)
grid.hideHocketPosition(id) grid.hideHocketPosition(id)
wake(new Explode) wake(new Explode)
} }