Imports System
Imports System.ComponentModel
Imports System.Collections

Public Class CircleSeeding
  Inherits StraightSeeding

  Private circlesd As Integer
  '-----
  Public Sub New(ByVal swmrs As Swimmers, ByVal lanes As Integer)
    MyBase.New(swmrs, lanes)
  End Sub
  '-----
  Public Overrides Sub seed()
    Dim i, j, k, numHeats As Integer
    'ustalenie porządku torów
    laneOrder = calcLaneOrder(numLanes)
    sw = sort(sw)                 'sortowanie wyników pływaków

    MyBase.seed()                 'rozstawienie
    numHeats = MyBase.getHeats
    If (numHeats >= 2) Then
      If (numHeats >= 3) Then
        circlesd = 3
      Else
        circlesd = 2
      End If
      i = 0
      'kopiowanie informacji o rozstawieniu do danych o pływakach
      For j = 0 To numLanes - 1
        For k = 1 To circlesd
          sw.swm(i).setLane(CType(laneOrder(j), Integer))
          sw.swm(i).setHeat(numHeats - k + 1)
          i = i + 1
        Next k
      Next j
    End If
  End Sub
  '-----
End Class

