lib/demiurge/container.rb
def receive_offer(action_name, intention)
      # Run handlers, if any
      on_actions = @state["on_action_handlers"]
      if on_actions && (on_actions[action_name] || on_actions["all"])
        run_action(on_actions["all"], intention, current_intention: intention) if on_actions["all"]
        run_action(on_actions[action_name], intention, current_intention: intention) if on_actions[action_name]
      end
      nil
    end
# When an item has an {Demiurge::Intention}, that Intention is
# offered in order to be potentially modified or cancelled by
# environmental effects. For instance, a room might have a muddy
# floor that slows walking or prevents running, or an icy floor
# that causes sliding around. That offer is normally coordinated
# through the item's location. The location will receive this
# callback ({#receive_offer}) and make appropriate modifications
# to the Intention. Any other items or agents that want to modify
# the Intention will have to coordinate with the appropriate item
# location.
#
# @see file:CONCEPTS.md
# @param action_name [String] The name of the action for this Intention.
# @param intention [Demiurge::Intention] The Intention being offered
# @return [void]
# @since 0.0.1
When an item has an {Demiurge::Intention}, that Intention is
offered in order to be potentially modified or cancelled by
environmental effects. For instance, a room might have a muddy
floor that slows walking or prevents running, or an icy floor
that causes sliding around. That offer is normally coordinated
through the item's location. The location will receive this
callback ({#receive_offer}) and make appropriate modifications
to the Intention. Any other items or agents that want to modify
the Intention will have to coordinate with the appropriate item
location.
When an item has an { Demiurge :: Intention } that Intention is offered in order to be potentially modified or cancelled by environmental effects . For instance a room might have a muddy floor that slows walking or prevents running or an icy floor that causes sliding around . That offer is normally coordinated through the item ' s location . The location will receive this callback ( { #receive_offer } ) and make appropriate modifications to the Intention . Any other items or agents that want to modify the Intention will have to coordinate with the appropriate item location .
def receive_offer(action_name, intention)
      on_actions = @state["on_action_handlers"]
      if on_actions && (on_actions[action_name] || on_actions["all"])
        run_action(on_actions["all"], intention, current_intention: intention) if on_actions["all"]
        run_action(on_actions[action_name], intention, current_intention: intention) if on_actions[action_name]
      end
      nil
    end
def receive_offer ( action_name , intention ) on_actions = @state [ "on_action_handlers" ] if on_actions && ( on_actions [ action_name ] || on_actions [ "all" ] ) run_action ( on_actions [ "all" ] , intention , current_intention : intention ) if on_actions [ "all" ] run_action ( on_actions [ action_name ] , intention , current_intention : intention ) if on_actions [ action_name ] end nil end
When an item has an {Demiurge::Intention}, that Intention is
offered in order to be potentially modified or cancelled by
environmental effects.
When an item has an { Demiurge :: Intention } that Intention is offered in order to be potentially modified or cancelled by environmental effects .
# Run handlers, if any
None
void
action_name
The name of the action for this Intention.
The name of the action for this Intention .
intention
The Intention being offered
The Intention being offered
see
None
since
None