Created
January 23, 2012 10:37
-
-
Save AymericG/1662398 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Team | |
{ | |
public List<Player> Players { get; set; } | |
public int TotalRuns | |
{ | |
get | |
{ | |
return Players.Sum(player => player.Runs); | |
} | |
} | |
public void Scorecard() | |
{ | |
foreach (var player in Players) | |
{ | |
GameLog.Add(player.Name + ": " + player.Runs + " runs"); | |
} | |
} | |
public Team () | |
{ | |
Players = new List<Player>(); | |
for (int i = 1; i < 12; i++) | |
{ | |
var player = new Player | |
{ | |
Name = "Player " + i, | |
Batting = 85 - (i*i) | |
}; | |
Players.Add(player); | |
} | |
} | |
public void Play() | |
{ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment