Class: TCOD::Map
- Inherits:
-
Object
- Object
- TCOD::Map
- Defined in:
- lib/libtcod/map.rb
Instance Attribute Summary collapse
-
#ptr ⇒ Object
readonly
Returns the value of attribute ptr.
Class Method Summary collapse
Instance Method Summary collapse
- #clone ⇒ Object
- #compute_fov(x, y, max_radius, light_walls, algo) ⇒ Object
- #in_fov?(x, y) ⇒ Boolean
-
#initialize(width, height) ⇒ Map
constructor
A new instance of Map.
- #set_properties(x, y, is_transparent, is_walkable) ⇒ Object
Constructor Details
Instance Attribute Details
#ptr ⇒ Object (readonly)
Returns the value of attribute ptr.
3 4 5 |
# File 'lib/libtcod/map.rb', line 3 def ptr @ptr end |
Class Method Details
.finalize(ptr) ⇒ Object
31 32 33 |
# File 'lib/libtcod/map.rb', line 31 def self.finalize(ptr) proc { TCOD.map_delete(ptr) } end |
Instance Method Details
#clone ⇒ Object
25 26 27 28 29 |
# File 'lib/libtcod/map.rb', line 25 def clone map = Map.new(@width, @height) TCOD.map_copy(@ptr, map.ptr) map end |
#compute_fov(x, y, max_radius, light_walls, algo) ⇒ Object
17 18 19 |
# File 'lib/libtcod/map.rb', line 17 def compute_fov(x, y, max_radius, light_walls, algo) TCOD.map_compute_fov(@ptr, x, y, max_radius, light_walls, algo) end |
#in_fov?(x, y) ⇒ Boolean
21 22 23 |
# File 'lib/libtcod/map.rb', line 21 def in_fov?(x, y) TCOD.map_is_in_fov(@ptr, x, y) end |
#set_properties(x, y, is_transparent, is_walkable) ⇒ Object
13 14 15 |
# File 'lib/libtcod/map.rb', line 13 def set_properties(x, y, is_transparent, is_walkable) TCOD.map_set_properties(@ptr, x, y, is_transparent, is_walkable) end |