lib/demiurge/location.rb
# Determine whether this coordinate location can accomodate an
# item of the given shape.
#
# For now, don't distinguish between walkable/swimmable or
# whatever, just say a collision value of 0 means valid,
# everything else is invalid.
#
# @param left_x [Integer] The lower (leftmost) X coordinate
# @param upper_y [Integer] The higher (upper) Y coordinate
# @return [Boolean] Whether the object can be accomodated
# @since 0.3.0
Determine whether this coordinate location can accomodate an
item of the given shape.

For now, don't distinguish between walkable/swimmable or
whatever, just say a collision value of 0 means valid,
everything else is invalid.
Determine whether this coordinate location can accomodate an item of the given shape . For now don ' t distinguish between walkable / swimmable or whatever just say a collision value of 0 means valid everything else is invalid .
def can_accomodate_shape?(left_x, upper_y, shape)
      case shape
      when "humanoid"
        return can_accomodate_dimensions?(left_x, upper_y, 2, 1)
      when "tiny"
        return can_accomodate_dimensions?(left_x, upper_y, 1, 1)
      else
        raise "Unknown shape #{shape.inspect} passed to can_accomodate_shape!"
      end
    end
def can_accomodate_shape? ( left_x , upper_y , shape ) case shape when "humanoid" return can_accomodate_dimensions? ( left_x , upper_y , 2 , 1 ) when "tiny" return can_accomodate_dimensions? ( left_x , upper_y , 1 , 1 ) else raise "Unknown shape #{shape.inspect} passed to can_accomodate_shape!" end end
Determine whether this coordinate location can accomodate an
item of the given shape.
Determine whether this coordinate location can accomodate an item of the given shape .
Whether the object can be accomodated
Whether the object can be accomodated
Boolean
left_x
The lower (leftmost) X coordinate
The lower ( leftmost ) X coordinate
upper_y
The higher (upper) Y coordinate
The higher ( upper ) Y coordinate
shape
since
None