class McBlocky::RelativeLocation

Public Instance Methods

+(other) click to toggle source
# File lib/mcblocky/location.rb, line 25
def +(other)
  if other.is_relative?
    RelativeLocation.new(x + other.x, y + other.y, z + other.z)
  else
    Location.new(x + other.x, y + other.y, z + other.z)
  end
end
-(other) click to toggle source
# File lib/mcblocky/location.rb, line 33
def -(other)
  if other.is_relative?
    RelativeLocation.new(x - other.x, y - other.y, z - other.z)
  else
    Location.new(x - other.x, y - other.y, z - other.z)
  end
end
is_relative?() click to toggle source
# File lib/mcblocky/location.rb, line 41
def is_relative?
  true
end