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

Private m_UserOnFloor As String
Private m_FloorOpen As Boolean

Public Property Get FloorOpen() As Boolean
    FloorOpen = m_FloorOpen
End Property

Public Property Let FloorOpen(ByVal NewValue As Boolean)
    m_FloorOpen = NewValue
    m_UserOnFloor = vbNullString
End Property

Public Property Get UserOnFloor() As String
    UserOnFloor = m_UserOnFloor
End Property

Public Property Let UserOnFloor(NewValue As String)
    m_UserOnFloor = NewValue
    m_FloorOpen = False
End Property

Public Function CanSpeak(ByVal Username As String)
    Dim Flags As Long
    
    Username = LCase$(Username)
    
    If (FloorOpen) Then
        CanSpeak = True
        Exit Function
    End If
    
    If (Username = LCase$(m_UserOnFloor)) Then
        CanSpeak = True
        Exit Function
    End If
    
    Flags = GetFlags(Username)
    CanSpeak = ((Flags And ACCESS_MASTER) = ACCESS_MASTER)
End Function

Public Property Get FloorTaken() As Boolean
    FloorTaken = (LenB(m_UserOnFloor) > 0)
End Property

Private Sub Class_Initialize()
    m_FloorOpen = True
End Sub
