Sha256: 32023773f0ed812c1620583fef7e836ab260a8af1a1af9cbe5c405c1d33c836f

Contents?: true

Size: 759 Bytes

Versions: 6

Compression:

Stored size: 759 Bytes

Contents

require 'whirled_peas/graphics/renderer'
require 'whirled_peas/utils/ansi'

module WhirledPeas
  module Animator
    class RendererConsumer
      def initialize(template_factory, device, width, height)
        @template_factory = template_factory
        @device = device
        @width = width
        @height = height
        @renders = []
      end

      def add_frameset(frameset)
        frameset.each_frame do |frame, args|
          template = template_factory.build(frame, args)
          renders << Graphics::Renderer.new(template, width, height).paint
        end
      end

      def process
        device.handle_renders(renders)
      end

      private

      attr_reader :template_factory, :device, :width, :height, :renders
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
whirled_peas-0.11.1 lib/whirled_peas/animator/renderer_consumer.rb
whirled_peas-0.11.0 lib/whirled_peas/animator/renderer_consumer.rb
whirled_peas-0.10.0 lib/whirled_peas/animator/renderer_consumer.rb
whirled_peas-0.9.1 lib/whirled_peas/animator/renderer_consumer.rb
whirled_peas-0.9.0 lib/whirled_peas/animator/renderer_consumer.rb
whirled_peas-0.8.0 lib/whirled_peas/animator/renderer_consumer.rb