VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "clsBanList"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
Option Compare Text

Dim BanList() As New objBanUser

Public Sub Add(B As objBanUser)
    If Not IsBanList(B.Username) Then
        B.Tick = DblTickCount
        If LenB(BanList(0).Username) = 0 Then
            Set BanList(0) = B
        Else
            ReDim Preserve BanList(UBound(BanList) + 1)
            Set BanList(UBound(BanList)) = B
        End If
    End If
End Sub

Public Function Count() As Long
On Error Resume Next
    Count = UBound(BanList)
End Function

Public Function Item(Index As Integer) As objBanUser
On Error Resume Next
    Set Item = BanList(Index)
End Function

Public Sub Remove(Username As String)
On Error GoTo hErr:
    Dim I As Integer
    If UBound(BanList) = 0 Then
        If BanList(0).Username = Username Then
            ReDim BanList(0)
        End If
    Else
        Dim C As Integer
        C = UBound(BanList)
        For I = C To 0 Step -1
            If BanList(I).Username = Username Then
                Dim r As Integer, C2 As Integer
                C2 = UBound(BanList) - 1
                For r = I To C2
                    Set BanList(r) = BanList(r + 1)
                Next
                ReDim Preserve BanList(C2)
            End If
        Next I
    End If
Exit Sub
hErr:
    Clear
End Sub

Public Function IsBanList(Username As String) As Boolean
    Dim I As Integer, C As Integer
    C = UBound(BanList)
    For I = C To 0 Step -1
        If BanList(I).Username = Username Then IsBanList = True: Exit Function
    Next
End Function

Public Sub Clear()
    ReDim BanList(0)
End Sub

Public Sub Class_Initialize()
    ReDim BanList(0) As New objBanUser
End Sub

Public Sub Class_Terminate()
    On Error Resume Next
    ReDim BanList(0)
End Sub
