Class: Falling::MapView
Instance Method Summary collapse
-
#initialize(universe:) ⇒ MapView
constructor
A new instance of MapView.
-
#refresh ⇒ Object
FIXME: Add smart camera centering.
Constructor Details
#initialize(universe:) ⇒ MapView
Returns a new instance of MapView.
7 8 9 10 11 |
# File 'lib/falling/map_view.rb', line 7 def initialize(universe:) Falling.logger.info "Initializing MapView." @universe = universe super() end |
Instance Method Details
#refresh ⇒ Object
FIXME: Add smart camera centering.
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/falling/map_view.rb', line 14 def refresh active_area. to_a[0, height]. each_with_index do |row_string, row_index| window.setpos row_offset + row_index, column_offset window.addstr row_string[0, width] end super end |