Class: RETerm::Components::Isometric

Inherits:
RETerm::Component show all
Defined in:
lib/reterm/components/isometric.rb

Overview

Renders specified isometric grid

Constant Summary

Constants included from LogHelpers

LogHelpers::LOG_FILE

Instance Attribute Summary

Attributes inherited from RETerm::Component

#activatable, #activate_focus, #highlight_focus, #window

Instance Method Summary collapse

Methods inherited from RETerm::Component

#activatable?, #activate!, #activate_focus?, #cdk?, #colored?, #colors=, #deactivate!, #deactivate?, #distance_from, #extra_padding, #finalize!, #highlight_focus?, #reactivate!, #resize, #sync!, #sync_getch

Methods included from KeyBindings

#bind_key, #invoke_key_bindings, #key_bindings, #key_bound?

Methods included from LogHelpers

#logger

Methods included from EventDispatcher

#dispatch, #handle

Constructor Details

#initialize(args = {}) ⇒ Isometric

Initialize the Isometric component

Parameters:

  • args (Hash) (defaults to: {})

    isometric params

Options Hash (args):

  • :matrix (Array<Array<Integer,Double>>)

    2-dimensional array containing Z values corresponding to x/y grid coordinates

Raises:

  • (ArgumentError)


11
12
13
14
15
16
17
# File 'lib/reterm/components/isometric.rb', line 11

def initialize(args={})
  super
  @matrix = args[:matrix] || [[]]

  raise ArgumentError unless @matrix.is_a?(Array) &&
                             @matrix.all? { |m| m.is_a?(Array) }
end

Instance Method Details

#draw!Object



25
26
27
# File 'lib/reterm/components/isometric.rb', line 25

def draw!
  refresh_win
end

#requested_colsObject



22
23
# File 'lib/reterm/components/isometric.rb', line 22

def requested_cols
end

#requested_rowsObject



19
20
# File 'lib/reterm/components/isometric.rb', line 19

def requested_rows
end