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

Private parent As AbstractEmployee
Private hasParent As Boolean
Private nm As String
Private salary As String
Private subordinates As Subords
'--------
Private Sub AbstractEmployee_add(nm As String, salary As Single)
  Err.Raise vbObjectError + 513, , "No subordinates in base employee class"
End Sub
'--------
Private Sub AbstractEmployee_addEmp(emp As AbstractEmployee)
  Err.Raise vbObjectError + 513, , "No subordinates in base employee class"
End Sub

Private Function AbstractEmployee_getBoss() As AbstractEmployee
  Set AbstractEmployee_getBoss = parent
End Function
'--------
Private Function AbstractEmployee_getChild(nm As String) As AbstractEmployee
  Set AbstractEmployee_getChild = Null
End Function
'--------
Private Function AbstractEmployee_getName() As String
  AbstractEmployee_getName = nm
End Function
'--------
Private Function AbstractEmployee_getSalaries() As Single
  AbstractEmployee_getSalaries = salary
End Function
'--------
Private Function AbstractEmployee_getSalary() As Single
  AbstractEmployee_getSalary = salary
End Function
'--------
Private Function AbstractEmployee_getSubordinates() As Subords
  Set AbstractEmployee_getSubordinates = subordinates
End Function
'--------
Private Sub AbstractEmployee_init(parnt As AbstractEmployee, name As String, money As Single)
  Set parent = parnt
  hasParent = True
  nm = name
  salary = money
  Set subordinates = New Subords
End Sub
'--------
Private Function AbstractEmployee_isLeaf() As Boolean
  AbstractEmployee_isLeaf = True
End Function

Private Sub AbstractEmployee_makeBoss(emp As AbstractEmployee)
  Err.Raise vbObjectError + 514, , "Employee is not a boss"
End Sub
'--------
Private Sub AbstractEmployee_remove(emp As AbstractEmployee)
  Err.Raise vbObjectError + 513, , "No subordinates in base employee class"
End Sub
'--------
Private Sub Class_Initialize()
  nm = ""
  salary = 0
End Sub
