Class: Amaze::Cell::Polar

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

Instance Attribute Summary collapse

Attributes inherited from Amaze::Cell

#column, #row

Instance Method Summary collapse

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

#ccwObject

The neighbor cells



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

def ccw
  @ccw
end

#cwObject

The neighbor cells



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

def cw
  @cw
end

#inwardObject

The neighbor cells



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

def inward
  @inward
end

#outwardObject (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

#neighborsObject



13
14
15
# File 'lib/amaze/cell/polar.rb', line 13

def neighbors
  [cw, ccw, inward, *outward].compact
end