package ocelot.desktop.ui.event.sources

import totoro.ocelot.brain.event.{Event, EventBus}

import java.util.concurrent.ConcurrentLinkedDeque

object BrainEvents {
  val events = new ConcurrentLinkedDeque[Event]()

  private val eventSubscription = EventBus.subscribe { event =>
    events.add(event)

    ()
  }

  def destroy(): Unit = {
    eventSubscription.cancel()
  }
}
