public static List<Player> GetPlayers(string playerFile) { var players = new List<Player>(); var gender = playerFile.ToLower().Contains("female") ? Gender.Female : Gender.Male; foreach (var line in File.ReadLines(playerFile)) { var splitLine = line.Split('|'); var player = new Player(int.Parse(splitLine[0]), splitLine[1], splitLine[2], splitLine[3], DateTime.Parse(splitLine[4]), splitLine[5], splitLine[6], gender); players.Add(player); } return players; }
public void AddPlayers(Player player1, Player player2) { Teams.Add(new Team(player1, player2)); }
public void AddPlayers(Player player) { Teams.Add(new Team(player)); }