Class: Amaze::Cell::Hex
- Inherits:
-
Amaze::Cell
- Object
- Amaze::Cell
- Amaze::Cell::Hex
- Defined in:
- lib/amaze/cell/hex.rb
Instance Attribute Summary collapse
-
#north ⇒ Object
The neighbor cells.
-
#northeast ⇒ Object
The neighbor cells.
-
#northwest ⇒ Object
The neighbor cells.
-
#south ⇒ Object
The neighbor cells.
-
#southeast ⇒ Object
The neighbor cells.
-
#southwest ⇒ Object
The neighbor cells.
Attributes inherited from Amaze::Cell
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
#north ⇒ Object
The neighbor cells
5 6 7 |
# File 'lib/amaze/cell/hex.rb', line 5 def north @north end |
#northeast ⇒ Object
The neighbor cells
5 6 7 |
# File 'lib/amaze/cell/hex.rb', line 5 def northeast @northeast end |
#northwest ⇒ Object
The neighbor cells
5 6 7 |
# File 'lib/amaze/cell/hex.rb', line 5 def northwest @northwest end |
#south ⇒ Object
The neighbor cells
5 6 7 |
# File 'lib/amaze/cell/hex.rb', line 5 def south @south end |
#southeast ⇒ Object
The neighbor cells
5 6 7 |
# File 'lib/amaze/cell/hex.rb', line 5 def southeast @southeast end |
#southwest ⇒ Object
The neighbor cells
5 6 7 |
# File 'lib/amaze/cell/hex.rb', line 5 def southwest @southwest end |
Instance Method Details
#neighbors ⇒ Object
7 8 9 |
# File 'lib/amaze/cell/hex.rb', line 7 def neighbors [north, northeast, southeast, south, northwest, southwest].compact end |