require "apocrodentia/game"
class AR::Events::Subscription < Proc
  attr_accessor :id
  attr_accessor :event_class

  def initialize args={}
    @id = AR::Game.gen_id
    @event_class = args[:event_class] || args[:_for] || args[:when] || AR::Events::Event
  end
  
  def is_for? event_class
    self.event_class == event_class
  end

end#class Events::Subscription


class AR::Events::OneTimeSubscription < AR::Events::Subscription

end

#this is for ai
class AR::Events::SubscriptionDesireChanger < AR::Events::Subscription
  attr_accessor :desire
  def initialize params
    super
    self.desire = params[:desire]
  end 

  def call *args
    super *args, desire
  end
end

