public NRLTeams(Team[] teamArray) { teams = new Team[teamArray.Length]; for(int i = 0; i < teamArray.Length; i++) { teams[i] = teamArray[i]; } }
static void Main(string[] args) { Team[] teamArray = new Team[5] { new Team("Eels"), new Team("Sharks"), new Team("Roosters"), new Team("Cowboys"), new Team("Storm") }; NRLTeams teams = new NRLTeams(teamArray); foreach(Team t in teams) { Console.WriteLine(t.name); } Console.ReadLine(); }
public NRLTeamsEnum(Team[] list) { teams = list; }