lib/tak/piece_set.rb
# Removes a piece from a set
#
# @param type [Symbol] Type of piece
#
# @return [Boolean] Whether the removal was valid
Removes a piece from a set
Removes a piece from a set
def remove(type)
      return false if @pieces[type] - 1 < 0
      if type == :capstone
        @capstones -= 1
      else
        @flats -= 1
      end
      true
    end
def remove ( type ) return false if @pieces [ type ] - 1 < 0 if type == :capstone @capstones -= 1 else @flats -= 1 end true end
Removes a piece from a set
Removes a piece from a set
Whether the removal was valid
Whether the removal was valid
Boolean
type
Type of piece
Type of piece