Sha256: 4bcb65b193a3833e7a61b4f07f3bde0e912992ff9f5a9a8e9933371b8777ac00

Contents?: true

Size: 384 Bytes

Versions: 9

Compression:

Stored size: 384 Bytes

Contents

module Bioshogi
  class MainClock
    def initialize
      @single_clocks = Location.inject({}) { |a, e| a.merge(e => SingleClock.new) }
      @counter = 0
    end

    def add(v)
      @single_clocks[Location[@counter]].add(v)
      @counter += 1
    end

    def last_clock
      @single_clocks[Location[@counter.pred]]
    end

    def to_s
      last_clock.to_s
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
bioshogi-0.0.15 lib/bioshogi/main_clock.rb
bioshogi-0.0.14 lib/bioshogi/main_clock.rb
bioshogi-0.0.10 lib/bioshogi/main_clock.rb
bioshogi-0.0.9 lib/bioshogi/main_clock.rb
bioshogi-0.0.8 lib/bioshogi/main_clock.rb
bioshogi-0.0.7 lib/bioshogi/main_clock.rb
bioshogi-0.0.5 lib/bioshogi/main_clock.rb
bioshogi-0.0.4 lib/bioshogi/main_clock.rb
bioshogi-0.0.3 lib/bioshogi/main_clock.rb