Class: FunCi::Tui::AnimationRenderer

Inherits:
Object
  • Object
show all
Defined in:
lib/fun_ci/tui/animation_renderer.rb

Constant Summary collapse

HEADER_HEIGHT =
HeaderAnimationManager::HEADER_HEIGHT

Instance Method Summary collapse

Constructor Details

#initialize(animation_library: AnimationLibrary) ⇒ AnimationRenderer

Returns a new instance of AnimationRenderer.



14
15
16
17
18
# File 'lib/fun_ci/tui/animation_renderer.rb', line 14

def initialize(animation_library: AnimationLibrary)
  @previous_runs = []
  @animations = []
  @header_manager = HeaderAnimationManager.new(animation_library: animation_library)
end

Instance Method Details

#active_countObject



37
38
39
# File 'lib/fun_ci/tui/animation_renderer.rb', line 37

def active_count
  @animations.count { |a| !a.finished? }
end

#any_active?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/fun_ci/tui/animation_renderer.rb', line 33

def any_active?
  @animations.any? { |a| !a.finished? } || @header_manager.any_active_event?
end

#render(screen, runs) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/fun_ci/tui/animation_renderer.rb', line 20

def render(screen, runs)
  detect_and_queue(runs)

  screen.save_cursor
  render_header_overlay(screen)
  render_stage_overlays(screen, runs)
  render_footer_overlay(screen, runs)
  screen.restore_cursor

  advance_all
  expire_finished
end