Public Class ActivityStartedState
Inherits ActivityState
'Not from other state.
Public Sub New(activity As IActivity, employee As IEmployee)
'Set the current activity of the employee, only happens in this state.
employee.CurrentActivity = Activity
Me.Activity = activity
Me.CurrentEmployee = employee
End Sub
'From other state.
Public Sub New(state As ActivityState, employee As IEmployee)
'Set the current activity of the employee, only happens in this state.
employee.CurrentActivity = Activity
Activity = state.Activity
Me.CurrentEmployee = employee
End Sub
'''
Public Overrides Function ActivityStateEnum() As ActivityStateEnum
Return ProductiePitching.ActivityStateEnum.Started
End Function
'''
Public Overrides Function GetEmployee() As IEmployee
Return CurrentEmployee
End Function
'''
Public Overrides Sub StopActivity()
Activity.State = New ActivityStoppedState(Me)
End Sub
'''
Public Overrides Sub FinishActivity()
'Update state.
Activity.State = New ActivityFinishedState(Me)
End Sub
End Class