Sha256: 8d4f948ef596a16899c19f6f226070cc1e62a802fe486be362b8f130268cd7b9

Contents?: true

Size: 670 Bytes

Versions: 3

Compression:

Stored size: 670 Bytes

Contents

class Wordcram
  class Placer
    def initialize(&block)
      @block = block
    end
            
    # This method is called from the java side, so I can't make the arguments
    # a hash key. Blame Java T_T
    def place(word, index, count, word_width, word_height, field_width, field_height)
      data = {}
      data[:word]         = word
      data[:index]        = index
      data[:count]        = count
      data[:word_width]   = word_width
      data[:word_height]  = word_height
      data[:field_width]  = field_width
      data[:field_height] = field_height

      pos = @block.call(data)

      Processing::PVector.new(pos[0], pos[1])
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
wordcram-1.0.2 lib/wordcram/placer.rb
wordcram-1.0.1 lib/wordcram/placer.rb
wordcram-1.0.0 lib/wordcram/placer.rb