-
Notifications
You must be signed in to change notification settings - Fork 2.4k
/
Scorecard.cs
50 lines (42 loc) · 1.07 KB
/
Scorecard.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using System.Collections.Generic;
namespace Cricinfo
{
public class Scorecard
{
private readonly string id;
private readonly Match match;
private readonly Dictionary<string, int> teamScores;
private readonly List<Innings> innings;
public Scorecard(string id, Match match)
{
this.id = id;
this.match = match;
this.teamScores = new Dictionary<string, int>();
this.innings = new List<Innings>();
}
public void UpdateScore(string teamId, int score)
{
teamScores[teamId] = score;
}
public void AddInnings(Innings innings)
{
this.innings.Add(innings);
}
public string GetId()
{
return id;
}
public Match GetMatch()
{
return match;
}
public Dictionary<string, int> GetTeamScores()
{
return teamScores;
}
public List<Innings> GetInnings()
{
return innings;
}
}
}