Class: Amaze::Cell::Square
- Inherits:
-
Amaze::Cell
- Object
- Amaze::Cell
- Amaze::Cell::Square
- Defined in:
- lib/amaze/cell/square.rb
Instance Attribute Summary collapse
-
#east ⇒ Object
The neighbor cells.
-
#north ⇒ Object
The neighbor cells.
-
#south ⇒ Object
The neighbor cells.
-
#west ⇒ 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
#east ⇒ Object
The neighbor cells
5 6 7 |
# File 'lib/amaze/cell/square.rb', line 5 def east @east end |
#north ⇒ Object
The neighbor cells
5 6 7 |
# File 'lib/amaze/cell/square.rb', line 5 def north @north end |
#south ⇒ Object
The neighbor cells
5 6 7 |
# File 'lib/amaze/cell/square.rb', line 5 def south @south end |
#west ⇒ Object
The neighbor cells
5 6 7 |
# File 'lib/amaze/cell/square.rb', line 5 def west @west end |
Instance Method Details
#neighbors ⇒ Object
7 8 9 |
# File 'lib/amaze/cell/square.rb', line 7 def neighbors [north, east, south, west].compact end |