Sha256: 9fe2bcf0eb959bf840ea7916be496ef622fc92d32e0d247d9fc8fa6dc89e4eeb

Contents?: true

Size: 682 Bytes

Versions: 1

Compression:

Stored size: 682 Bytes

Contents

# @gamefic.script standard/container

require 'gamefic-standard/openable'
require 'gamefic-standard/lockable'

class Container < Receptacle
  include Openable
  include Lockable
end

Gamefic.script do
  respond :insert, Use.available, Use.available(Container) do |actor, thing, container|
    if container.open?
      actor.proceed
    else
      actor.tell "#{The container} is closed."
    end
  end

  respond :leave, Use.parent(Container, :enterable?, :closed?) do |actor, container|
    actor.tell "#{The container} is closed."
  end

  respond :enter, Use.siblings(Container, :enterable?, :closed?) do |actor, container|
    actor.tell "#{The container} is closed."
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gamefic-standard-2.0.0 lib/gamefic-standard/container.rb