Sha256: 263f595256fd8cbdb3fb9a09aeeed7d3f89253e51f32ce3261298b50f8d208b3

Contents?: true

Size: 384 Bytes

Versions: 8

Compression:

Stored size: 384 Bytes

Contents

# run system with a single command
module Runnable
  def run
    reject!(&:done?)
    each(&:display)
  end
end

# A custom enumerable class, it is so easy in ruby
class ParticleSystem
  include Enumerable, Runnable
  extend Forwardable
  def_delegators(:@pairs, :each, :reject!, :<<)

  def initialize
    @pairs = []
  end

  def add_pair(x, y)
    self << Pair.new(x, y)
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
pbox2d-1.0.3-java examples/distance_joint/particle_system.rb
pbox2d-1.0.2-java examples/distance_joint/particle_system.rb
pbox2d-1.0.1-java examples/distance_joint/particle_system.rb
pbox2d-1.0.0-java examples/distance_joint/particle_system.rb
pbox2d-0.9.1-java examples/distance_joint/particle_system.rb
pbox2d-0.9.0-java examples/distance_joint/particle_system.rb
pbox2d-0.8.0-java examples/distance_joint/particle_system.rb
pbox2d-0.6.0-java examples/distance_joint/particle_system.rb