Class: Goby::Location

Inherits:
Object
  • Object
show all
Defined in:
lib/goby/util.rb

Overview

The combination of a map and y-x coordinates, which determine a specific position/location on the map.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(map, coords) ⇒ Location

Location constructor.

Parameters:

  • map (Map)

    the map component.

  • coords (C(Integer, Integer))

    a pair of y-x coordinates.



42
43
44
45
# File 'lib/goby/util.rb', line 42

def initialize(map, coords)
  @map = map
  @coords = coords
end

Instance Attribute Details

#coordsObject (readonly)

Returns the value of attribute coords.



47
48
49
# File 'lib/goby/util.rb', line 47

def coords
  @coords
end

#mapObject (readonly)

Returns the value of attribute map.



47
48
49
# File 'lib/goby/util.rb', line 47

def map
  @map
end