Class: Theseus::TransparentMask
- Inherits:
-
Object
- Object
- Theseus::TransparentMask
- Defined in:
- lib/theseus/mask.rb
Overview
This is the default mask used by a maze when an explicit mask is not given. It simply reports every cell as available.
mask = Theseus::TransparentMask.new(20, 20)
maze = Theseus::OrthogonalMaze.new(mask: mask)
Instance Attribute Summary collapse
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
-
#[](x, y) ⇒ Object
Always returns
true. -
#initialize(width = 0, height = 0) ⇒ TransparentMask
constructor
A new instance of TransparentMask.
Constructor Details
#initialize(width = 0, height = 0) ⇒ TransparentMask
Returns a new instance of TransparentMask.
103 104 105 106 |
# File 'lib/theseus/mask.rb', line 103 def initialize(width=0, height=0) @width = width @height = height end |
Instance Attribute Details
#height ⇒ Object (readonly)
Returns the value of attribute height.
101 102 103 |
# File 'lib/theseus/mask.rb', line 101 def height @height end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
101 102 103 |
# File 'lib/theseus/mask.rb', line 101 def width @width end |
Instance Method Details
#[](x, y) ⇒ Object
Always returns true.
109 110 111 |
# File 'lib/theseus/mask.rb', line 109 def [](x,y) true end |