lib/demiurge/container.rb
# This makes sure the given StateItem is contained in this
# container. It sets the item's position to be in this container,
# and if there is an old location it attempts to properly remove
# the item from it.
#
# @see Demiurge::Agent#move_to_position
# @param item [Demiurge::StateItem] The item to be moved into this container
# @return [void]
# @since 0.0.1
This makes sure the given StateItem is contained in this
container. It sets the item's position to be in this container,
and if there is an old location it attempts to properly remove
the item from it.
This makes sure the given StateItem is contained in this container . It sets the item ' s position to be in this container and if there is an old location it attempts to properly remove the item from it .
def move_item_inside(item)
      old_pos = item.position
      if old_pos
        old_loc_name = old_pos.split("#")[0]
        old_loc = @engine.item_by_name(old_loc_name)
        old_loc.ensure_does_not_contain(item.name)
      end
      @state["contents"] |= [ item.name ]
      nil
    end
def move_item_inside ( item ) old_pos = item . position if old_pos old_loc_name = old_pos . split ( "#" ) [ 0 ] old_loc = @engine . item_by_name ( old_loc_name ) old_loc . ensure_does_not_contain ( item . name ) end @state [ "contents" ] |= [ item . name ] nil end
This makes sure the given StateItem is contained in this
container.
This makes sure the given StateItem is contained in this container .
None
void
item
The item to be moved into this container
The item to be moved into this container
see
None
since
None