Class: Amaze::Cell::Hex

Inherits:
Amaze::Cell show all
Defined in:
lib/amaze/cell/hex.rb

Instance Attribute Summary collapse

Attributes inherited from Amaze::Cell

#column, #row

Instance Method Summary collapse

Methods inherited from Amaze::Cell

#distances, #initialize, #inspect, #link, #linked?, #linked_to?, #links, #to_s

Constructor Details

This class inherits a constructor from Amaze::Cell

Instance Attribute Details

#northObject

The neighbor cells



5
6
7
# File 'lib/amaze/cell/hex.rb', line 5

def north
  @north
end

#northeastObject

The neighbor cells



5
6
7
# File 'lib/amaze/cell/hex.rb', line 5

def northeast
  @northeast
end

#northwestObject

The neighbor cells



5
6
7
# File 'lib/amaze/cell/hex.rb', line 5

def northwest
  @northwest
end

#southObject

The neighbor cells



5
6
7
# File 'lib/amaze/cell/hex.rb', line 5

def south
  @south
end

#southeastObject

The neighbor cells



5
6
7
# File 'lib/amaze/cell/hex.rb', line 5

def southeast
  @southeast
end

#southwestObject

The neighbor cells



5
6
7
# File 'lib/amaze/cell/hex.rb', line 5

def southwest
  @southwest
end

Instance Method Details

#neighborsObject



7
8
9
# File 'lib/amaze/cell/hex.rb', line 7

def neighbors
  [north, northeast, southeast, south, northwest, southwest].compact
end