Sha256: 8cef53c417ecc284fb92d3d71c25c9ba66882bc685511ea13477808a6f52b717
Contents?: true
Size: 772 Bytes
Versions: 9
Compression:
Stored size: 772 Bytes
Contents
module Roughly XSMALL = 1 SMALL = 2 MEDIUM = 3 LARGE = 4 XLARGE = 5 end class Entity attr_writer :size def size @size ||= (is?(:portable) ? Roughly::SMALL : Roughly::MEDIUM) end end class Room def size @size ||= Roughly::XLARGE end end respond :drop_in, Query::Children.new(), Query::Reachable.new(Container) do |actor, thing, container| if container.size <= thing.size actor.tell "#{The thing} can't fit in #{the container}." else actor.proceed end end respond :drop_on, Query::Children.new(), Query::Reachable.new(Supporter) do |actor, thing, supporter| if supporter.size < thing.size actor.tell "#{The supporter} can't accommodate #{the thing}." else actor.proceed end end
Version data entries
9 entries across 9 versions & 1 rubygems