Sha256: f7df87a4402139e5058ad2db4fe0ae4e7ba90cd2387dc00519c956b1ec3a6e4b

Contents?: true

Size: 662 Bytes

Versions: 2

Compression:

Stored size: 662 Bytes

Contents

# frozen-string-literal: true

module Bioshogi
  module Formatter
    class StyleEmbed
      attr_accessor :xparser
      attr_accessor :container

      def initialize(xparser, container)
        @xparser = xparser
        @container = container
      end

      def call
        if @xparser.preset_info
          if @xparser.preset_info.special_piece
            @container.players.each do |player|
              if main_style_info = player.skill_set.main_style_info
                @xparser.pi.header.object.update("#{player.call_name}の棋風" => main_style_info.name)
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bioshogi-0.0.15 lib/bioshogi/formatter/style_embed.rb
bioshogi-0.0.14 lib/bioshogi/formatter/style_embed.rb