Sha256: 67369f66f0bc32d2e761c78bc72cd33e5428ee31f721e357c8cbf80ed0314ada

Contents?: true

Size: 287 Bytes

Versions: 6

Compression:

Stored size: 287 Bytes

Contents

class Explosion
  attr_accessor :x
  attr_accessor :y
  attr_accessor :t
  attr_accessor :dead

  def initialize bf, x, y
    @x, @y, @t = x, y, 0
    @battlefield, dead = bf, false
  end

  def state
    {:x=>x, :y=>y, :t=>t}
  end

  def tick
    @t += 1
    @dead ||= t > 15
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
rrobots-0.0.1 lib/rrobots/explosion.rb
UG_RRobots-2.0 lib/explosions.rb
UG_RRobots-1.3 lib/explosions.rb
UG_RRobots-1.2 lib/explosions.rb
UG_RRobots-2.2 lib/explosions.rb
UG_RRobots-2.1 lib/explosions.rb