lib/demiurge/location.rb
def valid_position?(pos)
      return false unless pos[0...@name.size] == @name
      return false unless pos[@name.size] == "#"
      x, y = pos[(@name.size + 1)..-1].split(",", 2).map(&:to_i)
      valid_coordinate?(x, y)
    end
# This just determines if the position is valid at all.  It does
# *not* check walkable/swimmable or even if it's big enough for a
# humanoid to stand in.
#
# @param pos [String] The position being checked
# @return [Boolean] Whether the position is valid
# @since 0.2.0
This just determines if the position is valid at all.  It does
not* check walkable/swimmable or even if it's big enough for a
humanoid to stand in.
This just determines if the position is valid at all . It does not * check walkable / swimmable or even if it ' s big enough for a humanoid to stand in .
def valid_position?(pos)
      return false unless pos[0...@name.size] == @name
      return false unless pos[@name.size] == "#"
      x, y = pos[(@name.size + 1)..-1].split(",", 2).map(&:to_i)
      valid_coordinate?(x, y)
    end
def valid_position? ( pos ) return false unless pos [ 0 ... @name . size ] == @name return false unless pos [ @name . size ] == "#" x , y = pos [ ( @name . size + 1 ) .. - 1 ] . split ( "," , 2 ) . map ( & :to_i ) valid_coordinate? ( x , y ) end
This just determines if the position is valid at all.
This just determines if the position is valid at all .
Whether the position is valid
Whether the position is valid
Boolean
pos
The position being checked
The position being checked
since
None