Class: Conwy::World::CellGrid::Coordinate

Inherits:
Struct
  • Object
show all
Defined in:
lib/conwy/world.rb

Instance Method Summary collapse

Instance Method Details

#negative?Boolean

Returns:

  • (Boolean)


61
62
63
# File 'lib/conwy/world.rb', line 61

def negative?
  x < 0 || y < 0
end

#neighborsObject



65
66
67
68
69
# File 'lib/conwy/world.rb', line 65

def neighbors
  neighbor_shifts.map do |x, y|
    shift(x, y)
  end
end