actor Painter let listener: Main var history: Array[Ressource box] = Array[Ressource box] new create(listener': Main) => listener = listener' be paint(res: Ressource iso) => if res.level() > 0 then history.push(consume res) listener.notify(stats()) else res.fill() paint(consume res) end fun stats(): String => var msg: String = "the painter has consumed: " for x in Properties.list() do var sum: U64 = 0 for y in history.values() do sum = sum + if y.name is x then y.level() else 0 end end msg = msg + Properties.name(x) + ": " + sum.string() + "; " end msg