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:
parent
9316a74f07
commit
ed1ce51747
@ -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
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
|
@ -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)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user