Class: RDGC::Map::Tile
- Inherits:
-
Object
- Object
- RDGC::Map::Tile
- Defined in:
- lib/rdgc/map/tile.rb
Instance Method Summary collapse
-
#initialize(type) ⇒ Tile
constructor
A new instance of Tile.
- #movable? ⇒ Boolean
- #out? ⇒ Boolean
- #road? ⇒ Boolean
- #room? ⇒ Boolean
- #wall? ⇒ Boolean
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
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
17 18 19 |
# File 'lib/rdgc/map/tile.rb', line 17 def out? @type == :out ? true : false end |
#road? ⇒ Boolean
29 30 31 |
# File 'lib/rdgc/map/tile.rb', line 29 def road? @type == :road ? true : false end |
#room? ⇒ Boolean
25 26 27 |
# File 'lib/rdgc/map/tile.rb', line 25 def room? @type == :room ? true : false end |
#wall? ⇒ Boolean
21 22 23 |
# File 'lib/rdgc/map/tile.rb', line 21 def wall? @type == :wall ? true : false end |