Sha256: f3d60a384b76cf6a064de4931775592e065a881a5f9db7231d8e6376d10f1dcd

Contents?: true

Size: 648 Bytes

Versions: 3

Compression:

Stored size: 648 Bytes

Contents

require 'cairo'

module Squib::Args
  module_function def extract_hand_special(opts, deck)
    HandSpecial.new(deck.height).extract! opts, deck
  end

  class HandSpecial
    include ArgLoader

    def initialize(card_height)
      @card_height = card_height
    end

    def self.parameters
      {
        angle_range: (Math::PI / -4.0)..(Math::PI / 4),
        radius: :auto
      }
    end

    def self.expanding_parameters
      [] # none of them
    end

    def self.params_with_units
      [ :radius ]
    end

    def validate_radius(arg)
      return 0.3 * @card_height if arg.to_s.downcase.strip == 'auto'
      arg
    end

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
squib-0.19.0 lib/squib/args/hand_special.rb
squib-0.19.0b lib/squib/args/hand_special.rb
squib-0.19.0a lib/squib/args/hand_special.rb