Class: Amaze::Cell::Square

Inherits:
Amaze::Cell show all
Defined in:
lib/amaze/cell/square.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

#eastObject

The neighbor cells



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

def east
  @east
end

#northObject

The neighbor cells



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

def north
  @north
end

#southObject

The neighbor cells



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

def south
  @south
end

#westObject

The neighbor cells



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

def west
  @west
end

Instance Method Details

#neighborsObject



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

def neighbors
  [north, east, south, west].compact
end