-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBaseballStats.cs
30 lines (27 loc) · 959 Bytes
/
BaseballStats.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BaseballStatObserverPattern
{
class BaseballStats
{
static void Main(string[] args)
{
// Subject (notifier)
BaseballData baseballData = new BaseballData();
// Observers
ESPNReport espn = new ESPNReport(baseballData);
NewspaperReport paper = new NewspaperReport(baseballData);
OnlinePredictor online = new OnlinePredictor(baseballData);
baseballData.setBaseballData(4, 3, 1);
baseballData.setBaseballData(4, 0, 3);
baseballData.setBaseballData(4, 0, 2);
baseballData.setBaseballData(4, 1, 2);
baseballData.setBaseballData(4, 4, 3);
baseballData.setBaseballData(3, 2, 1);
baseballData.setBaseballData(5, 2, 2);
baseballData.setBaseballData(3, 2, 0);
}
}
}