Sha256: bd2ccdc5d2d9da6388be084ed91fddcc3631f97d72bd6d329903ef305431eab7

Contents?: true

Size: 876 Bytes

Versions: 9

Compression:

Stored size: 876 Bytes

Contents

# frozen-string-literal: true

module Bioshogi
  class Piece
    class PieceCsa
      include ApplicationMemoryRecord
      memory_record [
        { key: :king,   basic_name: "OU", promoted_name: nil,  },
        { key: :rook,   basic_name: "HI", promoted_name: "RY", },
        { key: :bishop, basic_name: "KA", promoted_name: "UM", },
        { key: :gold,   basic_name: "KI", promoted_name: nil,  },
        { key: :silver, basic_name: "GI", promoted_name: "NG", },
        { key: :knight, basic_name: "KE", promoted_name: "NK", },
        { key: :lance,  basic_name: "KY", promoted_name: "NY", },
        { key: :pawn,   basic_name: "FU", promoted_name: "TO", },
      ]

      def piece
        Piece.fetch(key)
      end

      def any_name(promoted)
        if promoted
          promoted_name
        else
          basic_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/piece_csa.rb
bioshogi-0.0.14 lib/bioshogi/piece/piece_csa.rb
bioshogi-0.0.10 lib/bioshogi/piece/piece_csa.rb
bioshogi-0.0.9 lib/bioshogi/piece/piece_csa.rb
bioshogi-0.0.8 lib/bioshogi/piece/piece_csa.rb
bioshogi-0.0.7 lib/bioshogi/piece/piece_csa.rb
bioshogi-0.0.5 lib/bioshogi/piece/piece_csa.rb
bioshogi-0.0.4 lib/bioshogi/piece/piece_csa.rb
bioshogi-0.0.3 lib/bioshogi/piece/piece_csa.rb