Class: Amaze::Cell::Polar
- Inherits:
-
Amaze::Cell
- Object
- Amaze::Cell
- Amaze::Cell::Polar
- Defined in:
- lib/amaze/cell/polar.rb
Instance Attribute Summary collapse
-
#ccw ⇒ Object
The neighbor cells.
-
#cw ⇒ Object
The neighbor cells.
-
#inward ⇒ Object
The neighbor cells.
-
#outward ⇒ Object
readonly
Returns the value of attribute outward.
Attributes inherited from Amaze::Cell
Instance Method Summary collapse
-
#initialize(row, column) ⇒ Polar
constructor
A new instance of Polar.
- #neighbors ⇒ Object
Methods inherited from Amaze::Cell
#distances, #inspect, #link, #linked?, #linked_to?, #links, #to_s
Constructor Details
#initialize(row, column) ⇒ Polar
Returns a new instance of Polar.
8 9 10 11 |
# File 'lib/amaze/cell/polar.rb', line 8 def initialize(row, column) super @outward = [] end |
Instance Attribute Details
#ccw ⇒ Object
The neighbor cells
5 6 7 |
# File 'lib/amaze/cell/polar.rb', line 5 def ccw @ccw end |
#cw ⇒ Object
The neighbor cells
5 6 7 |
# File 'lib/amaze/cell/polar.rb', line 5 def cw @cw end |
#inward ⇒ Object
The neighbor cells
5 6 7 |
# File 'lib/amaze/cell/polar.rb', line 5 def inward @inward end |
#outward ⇒ Object (readonly)
Returns the value of attribute outward.
6 7 8 |
# File 'lib/amaze/cell/polar.rb', line 6 def outward @outward end |
Instance Method Details
#neighbors ⇒ Object
13 14 15 |
# File 'lib/amaze/cell/polar.rb', line 13 def neighbors [cw, ccw, inward, *outward].compact end |