Sha256: 3436c24e1a1a8c0e410cb7fc943420a60b9203fea2b16e1ff212f11770011f47

Contents?: true

Size: 494 Bytes

Versions: 1

Compression:

Stored size: 494 Bytes

Contents

module Rubot::Adapters::Aria
  class ActionDesired
    %w[ velocity delta_heading heading ].each do |channel|
      eval <<-CHAN_DEF
        private :set_#{channel}

        def #{channel}=(val)
          # Use current channel strength, or maximum (1) if not set.
          set_#{channel} val, (#{channel}_strength != 0 ? #{channel}_strength : 1)
        end

        def #{channel}_strength=(strength)
          set_#{channel} #{channel}, strength
        end
      CHAN_DEF
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
Peeja-rubot-0.5.0 lib/rubot/adapters/aria/action_desired.rb