-
Notifications
You must be signed in to change notification settings - Fork 0
/
Fan.cs
32 lines (30 loc) · 903 Bytes
/
Fan.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EventApp
{
class Fan
{
public Fan(Ball ball)
{
ball.BallInPlay += new EventHandler(ball_BallInPlay);
}
private void ball_BallInPlay(object sender, EventArgs e)
{
if (e is BallEventArgs)
{
BallEventArgs ballEventArgs = e as BallEventArgs;
if ((ballEventArgs.Distance >= 400) && (ballEventArgs.Trajectory >= 30))
{
Console.WriteLine("Fan: Home RUN !!!!");
}
else
Console.WriteLine("Fan: woo hoo YEAH!!");
}
//int th = System.Threading.Thread.CurrentThread.ManagedThreadId;
//Console.WriteLine("n° thread : " + th);
}
}
}