Sha256: a0103241b7dc9764277d7110f9dfd8be851b3e6fbcc269fbf08e90b9b66850d3

Contents?: true

Size: 823 Bytes

Versions: 9

Compression:

Stored size: 823 Bytes

Contents

# frozen-string-literal: true

module Bioshogi
  concern :HandLogsMod do
    def turn_ended_process
      super

      container.hand_logs << hand_log
    end

    def hand_log
      @hand_log ||= HandLog.new({
          :drop_hand          => @drop_hand,
          :move_hand          => @move_hand,
          :candidate_soldiers => @candidate_soldiers, # nil の場合もある
          :place_same         => place_same?,
          :skill_set          => skill_set,
          :handicap           => container.turn_info.handicap?,
          :single_clock       => player.single_clock.clone.freeze, # 時計の状態を保持して手に結びつける
        }).freeze
    end

    def place_same?
      if hand_log = container.hand_logs.last
        hand_log.soldier.place == soldier.place
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

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