module AR::Game::RestStation 
  
  #add attr_accessor properties here... 
  #if you don't need them serialized on save

  #...initialize them here
  def self.init ar_object 
    #add attr_serializeable properties here... 
    #if you do need them serialized on save
    #ar_object.attr_serializeable :prop1, :prop2, &block

  end

  def self.extended ar_object
    self.init ar_object
    
    ar_object.resolutions.push release_health_hunger_changes_on_char_rest
    #add to object's event subscriptions and resolutions here...

  end 

  def self.release_health_hunger_changes_on_char_rest
    AR::Events::Resolution.new event_class: AR::Events::CharacterSlept, as: "station" do |e|
      ch = e.rester
      health = ch.gauge("health")
      hunger = ch.gauge("hunger")
      diff = health.modified_max - health.modified_current

      results = []
      results.push(AR::Events::GaugeChanged.new gauge: health, which: "current", amount: diff)
      results.push(AR::Events::GaugeChanged.new gauge: hunger, which: "current", amount: diff*2)
      results
    end
  end


  #add more methods here

end
