VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "CircleSeeding"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
Implements Seeding
Private sd As Seeding
Private sw As Collection
Private numLanes As Integer, numheats As Integer
Private laneOrder As Collection
Private strSd As Seeding
Private circlesd As Integer
'-----
Private Sub Class_Initialize()
  Set sd = New Seeding
  Set strSd = New StraightSeeding
End Sub
'-----
Private Function Seeding_calcLaneOrder(lanes As Integer) As Collection
End Function
'-----
Private Function Seeding_getCount() As Integer
End Function
'-----
Private Function Seeding_getHeat() As Integer
End Function
'-----
Private Function Seeding_getHeats() As Integer
Seeding_getHeats = numheats
End Function
'-----
Private Function Seeding_getSeeding() As Collection
  Set Seeding_getSeeding = sw
End Function
'-----
Private Function Seeding_getSwimmers() As Collection
  Set Seeding_getSwimmers = sw
End Function
Private Sub Seeding_seed()
  Dim i As Integer, j As Integer, k As Integer
  'Uzyskaj kolejność obsadzenia torów
  Set laneOrder = sd.calcLaneOrder(numLanes)
  Set sw = sd.sort(sw)    'Posortuj zawodników
  strSd.init sw, numLanes 'Utwórz instancję klasy StraightSeeding
  strSd.seed              'Zastosuj rozstawienie bezpośrednie
  numheats = strSd.getHeats   'Pobierz liczbę wyścigów
  If (numheats >= 2) Then
    If (numheats >= 3) Then
      circlesd = 3      'Rozstawiaj trójkami
    Else
      circlesd = 2      'Lub parami
    End If
    i = 1
    'Skopiuj informację o rozstawieniu do obiektów Swimmer
    For j = 1 To numLanes
      For k = 1 To circlesd
        sw(i).setLane (laneOrder(j))
        sw(i).setHeat (numheats - k + 1)
        i = i + 1
      Next k
    Next j
  End If
End Sub
'-----
Private Sub Seeding_init(swmrs As Collection, lanes As Integer)
  Set sw = swmrs
  numLanes = lanes
End Sub
'-----
Private Function Seeding_sort(sw As Collection) As Collection
End Function
'-----
Public Function seed(swmr As Collection) As Collection
  Set sw = swmr
  Seeding_seed
  Set seed = swmr
End Function

