def add_result(result)
      raise "invalid result" unless result.class == ICU::Result
      raise "player number (#{@num}) is not matched to result player number (#{result.inspect})" unless @num == result.player
      already = @results.find_all { |r| r.round == result.round }
      return if already.size == 1 && already[0].eql?(result)
      raise "player #{@num} already has a result in round #{result.round} (#{already[0].inspect}) which does not match the one being added (#{result.inspect})" unless already.size == 0
      if @results.size == 0 || @results.last.round <= result.round
        @results << result
      else
        i = (0..@results.size-1).find { |n| @results[n].round > result.round }
        @results.insert(i, result)
      end
    end
def add_result(result)
      raise "invalid result" unless result.class == ICU::Result
      raise "player number (#{@num}) is not matched to result player number (#{result.inspect})" unless @num == result.player
      already = @results.find_all { |r| r.round == result.round }
      return if already.size == 1 && already[0].eql?(result)
      raise "player #{@num} already has a result in round #{result.round} (#{already[0].inspect}) which does not match the one being added (#{result.inspect})" unless already.size == 0
      if @results.size == 0 || @results.last.round <= result.round
        @results << result
      else
        i = (0..@results.size-1).find { |n| @results[n].round > result.round }
        @results.insert(i, result)
      end
    end
Add a result. Don't use this method directly - use ICU::Tournament#add_result instead.