Sometimes it's all about knowing the right objects to call....
Code:
private function MakeTea() as ICup(Of Tea)
Dim myTeaPot as New Vessels.TeaPot
'1. Put the water into the water container
myTeaPot.Fill(new Water(KitchenFaucet))
'2. Turn on the heating mechanism
mStove.Burner(FrontLeft).Start
'3. Put the water container onto the heating
mStove.Burner(FrontLeft).Add(myTeaPot)
'4. While waiting for the water to boil:
AddHandler myTeaPot.Boiling, AddressOf teaPotHandler_Boil
'(4.1) Put the Tea / Tea bag into the Cup
Dim myCup as new ICup(Of Tea)
'(4.2) If milk is required than add milk
myCup.Add(Milk)
'(4.3) If sugar is required then add it to the tea
myCup.Add(Sweetner)
'(4.4) If water has not yet boiled, wait
Do While not myTeaPot.IsBoiling
Me.WatchPot(False)
Me.DoEvents 'Yes it's a busy wait but there isn't much choice
Loop
'6. Pour the hot water into the cup
myCup.Fill(myTeaPot)
'7. Wait for it to brew to the strength required
Thread.Wait(300) 'Takes about 5 minutes
'8. Stir the mixture
myCup.Stir
'9. End
return myCup
End Function
private sub teaPotHandler_Boil(s as sender, e as EventArgsBoil)
'5. Remove the water container from the heat and turn off the heating mechanism
mStove.Burner(FrontLeft).Remove(DirectCast(s, Vessels.TeaPot))
end sub
-tg