Class: RDGC::Map::Tile

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

Instance Method Summary collapse

Constructor Details

#initialize(type) ⇒ Tile

Returns a new instance of Tile.



6
7
8
9
# File 'lib/rdgc/map/tile.rb', line 6

def initialize(type)
  @type = type
  @type.freeze
end

Instance Method Details

#movable?Boolean

Returns:

  • (Boolean)


11
12
13
14
15
# File 'lib/rdgc/map/tile.rb', line 11

def movable?
  return false if out?
  return false if wall?
  true
end

#out?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/rdgc/map/tile.rb', line 17

def out?
  @type == :out ? true : false
end

#road?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/rdgc/map/tile.rb', line 29

def road?
  @type == :road ? true : false
end

#room?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/rdgc/map/tile.rb', line 25

def room?
  @type == :room ? true : false
end

#wall?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/rdgc/map/tile.rb', line 21

def wall?
  @type == :wall ? true : false
end