Class: Maze::Formatter::Png::Orthogonal

Inherits:
Object
  • Object
show all
Includes:
Maze::Formatter::Png
Defined in:
lib/maze/formatters/png/orthogonal.rb

Constant Summary

Constants included from Maze::Formatter::Png

LENGTH, PADDING

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Maze::Formatter::Png

#draw

Constructor Details

#initialize(maze) ⇒ Orthogonal

Returns a new instance of Orthogonal.



12
13
14
15
16
17
18
# File 'lib/maze/formatters/png/orthogonal.rb', line 12

def initialize(maze)
  @maze    = maze
  @image   = ChunkyPNG::Image.new(width, height, background_colour)
  @lines   = []

  draw_image
end

Instance Attribute Details

#imageObject (readonly)

Returns the value of attribute image.



8
9
10
# File 'lib/maze/formatters/png/orthogonal.rb', line 8

def image
  @image
end

#linesObject (readonly)

Returns the value of attribute lines.



8
9
10
# File 'lib/maze/formatters/png/orthogonal.rb', line 8

def lines
  @lines
end

#mazeObject (readonly)

Returns the value of attribute maze.



8
9
10
# File 'lib/maze/formatters/png/orthogonal.rb', line 8

def maze
  @maze
end