Class: BaseTile
- Inherits:
-
Object
- Object
- BaseTile
- Defined in:
- lib/cave_gen/tile.rb
Instance Attribute Summary collapse
-
#opacity ⇒ Object
Returns the value of attribute opacity.
-
#symbol ⇒ Object
Returns the value of attribute symbol.
-
#touched ⇒ Object
Returns the value of attribute touched.
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Instance Method Summary collapse
- #get_tile ⇒ Object
-
#initialize(y, x, opacity = 0, touched = 0) ⇒ BaseTile
constructor
A new instance of BaseTile.
- #is_floor? ⇒ Boolean
- #print_tile ⇒ Object
Constructor Details
#initialize(y, x, opacity = 0, touched = 0) ⇒ BaseTile
Returns a new instance of BaseTile.
8 9 10 11 12 13 14 |
# File 'lib/cave_gen/tile.rb', line 8 def initialize(y, x, opacity = 0, touched = 0) @y = y @x = x @touched = touched @opacity = opacity @symbol = " " end |
Instance Attribute Details
#opacity ⇒ Object
Returns the value of attribute opacity.
4 5 6 |
# File 'lib/cave_gen/tile.rb', line 4 def opacity @opacity end |
#symbol ⇒ Object
Returns the value of attribute symbol.
6 7 8 |
# File 'lib/cave_gen/tile.rb', line 6 def symbol @symbol end |
#touched ⇒ Object
Returns the value of attribute touched.
5 6 7 |
# File 'lib/cave_gen/tile.rb', line 5 def touched @touched end |
#x ⇒ Object
Returns the value of attribute x.
2 3 4 |
# File 'lib/cave_gen/tile.rb', line 2 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
3 4 5 |
# File 'lib/cave_gen/tile.rb', line 3 def y @y end |
Instance Method Details
#get_tile ⇒ Object
20 21 22 |
# File 'lib/cave_gen/tile.rb', line 20 def get_tile @symbol end |
#is_floor? ⇒ Boolean
24 25 26 |
# File 'lib/cave_gen/tile.rb', line 24 def is_floor? return false end |
#print_tile ⇒ Object
16 17 18 |
# File 'lib/cave_gen/tile.rb', line 16 def print_tile print @symbol end |