Sha256: 0e7e32bc23d8eb3c2197d329c5c92f6d94ee4421b7f12ca6b99427dcb1c34a9a

Contents?: true

Size: 409 Bytes

Versions: 5

Compression:

Stored size: 409 Bytes

Contents

class Piece

  # @!attribute [r] type
  # @return [PieceType]
  attr_reader :type

  # @!attribute [r] color
  # @return [PlayerColor]
  attr_reader :color

  def initialize(color, type)
    @type = type
    @color = color
  end

  def ==(other)
    type == other.type && color == other.color
  end

  def owner
    color
  end

  def to_s
    color.value + type.value
  end

  def inspect
    to_s
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
software_challenge_client-20.2.4 lib/software_challenge_client/piece.rb
software_challenge_client-20.2.3 lib/software_challenge_client/piece.rb
software_challenge_client-20.2.2 lib/software_challenge_client/piece.rb
software_challenge_client-20.2.1 lib/software_challenge_client/piece.rb
software_challenge_client-20.2.0 lib/software_challenge_client/piece.rb