event_queue :: EventInfo :: expire
The event can be active of not.
var eq = new EventQueue[String]
var e1 = eq.add("active", 0.0, 10.0)
var e2 = eq.add("not active", 2.0, 10.0)
var es = eq.update(1.0)
assert es == [e1]
e1.expire
e2.expire
es = eq.update(2.0)
assert es.is_empty
Note that when an event is forced to expire,
it will not appears in the next update
.
# Force the event to expire.
#
# The event can be active of not.
#
# ~~~
# var eq = new EventQueue[String]
# var e1 = eq.add("active", 0.0, 10.0)
# var e2 = eq.add("not active", 2.0, 10.0)
# var es = eq.update(1.0)
# assert es == [e1]
# e1.expire
# e2.expire
# es = eq.update(2.0)
# assert es.is_empty
# ~~~
#
# Note that when an event is forced to expire,
# it will not appears in the next `update`.
fun expire do has_expired = true
lib/event_queue/event_queue.nit:356,2--374,33