private void WriteToAdmin(string name, string email, ShirtSizeType shirtSize, TeamType color) { using (var fileStream = new FileStream(_adminFilename, FileMode.Append)) using (var streamWriter = new StreamWriter(fileStream)) { streamWriter.WriteLine($"{name},{email},{shirtSize:G},{color}"); } }
public TeamType AddPlayer(string name, string email, ShirtSizeType shirtSize) { var redTeamCount = GetTeamCount(_redTeamFilename); var blackTeamCount = GetTeamCount(_blackTeamFilename); if (blackTeamCount > redTeamCount) { WriteToRedTeam(name); WriteToAdmin(name, email, shirtSize, TeamType.Red); return(TeamType.Red); } WriteToBlackTeam(name); WriteToAdmin(name, email, shirtSize, TeamType.Black); return(TeamType.Black); }
public TeamType AddPlayer(string name, string email, ShirtSizeType shirtSize) { return(TeamType.Red); }