Class: BaseTile

Inherits:
Object
  • Object
show all
Defined in:
lib/cave_gen/tile.rb

Direct Known Subclasses

Floor, Wall

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#opacityObject

Returns the value of attribute opacity.



4
5
6
# File 'lib/cave_gen/tile.rb', line 4

def opacity
  @opacity
end

#symbolObject

Returns the value of attribute symbol.



6
7
8
# File 'lib/cave_gen/tile.rb', line 6

def symbol
  @symbol
end

#touchedObject

Returns the value of attribute touched.



5
6
7
# File 'lib/cave_gen/tile.rb', line 5

def touched
  @touched
end

#xObject

Returns the value of attribute x.



2
3
4
# File 'lib/cave_gen/tile.rb', line 2

def x
  @x
end

#yObject

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_tileObject



20
21
22
# File 'lib/cave_gen/tile.rb', line 20

def get_tile
  @symbol
end

#is_floor?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/cave_gen/tile.rb', line 24

def is_floor?
  return false
end


16
17
18
# File 'lib/cave_gen/tile.rb', line 16

def print_tile
  print @symbol
end