Sha256: bb260a313cdae5a65f73bd59aa9d441651adc8c56af412cbd7b4e4c8d4148bd7

Contents?: true

Size: 1.1 KB

Versions: 9

Compression:

Stored size: 1.1 KB

Contents

# frozen-string-literal: true

module Bioshogi
  class Piece
    class YomiagePieceInfo
      include ApplicationMemoryRecord
      memory_record [
        { key: :king,   name: "gyoku",  promoted_name: nil,         },
        { key: :rook,   name: "hisha",  promoted_name: "ryu",       }, # 「飛車」だと発音がおかしいため
        { key: :bishop, name: "kaku",   promoted_name: "うま",      }, # 「角」は「かど」、「馬」は「ば」と読まれてしまうため
        { key: :gold,   name: "kin",    promoted_name: nil,         },
        { key: :silver, name: "銀",     promoted_name: "なり銀",    }, # 「なりgin」は「なりじん」と読まれてしまう
        { key: :knight, name: "keima",  promoted_name: "なりkei",   },
        { key: :lance,  name: "kyo",    promoted_name: "なりkyo",   },
        { key: :pawn,   name: "hu",     promoted_name: "「と」",    },
      ]

      def piece
        Piece.fetch(key)
      end

      def yomiage(promoted)
        if promoted
          promoted_name
        else
          name
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

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