Team.cs 636 B

12345678910111213141516171819202122232425262728293031
  1. using System;
  2. using System.Linq;
  3. namespace MISTBowl_Brackets
  4. {
  5. public class Team
  6. {
  7. public string teamId = string.Empty;
  8. public int points;
  9. public string region = string.Empty;
  10. public Team(string[] input)
  11. {
  12. try
  13. {
  14. if (input.Length < 2 || input.Length > 3)
  15. throw new ArgumentException();
  16. teamId = input[0].Contains('/') ? string.Join("/", input[0].Split('/').OrderBy(a => int.Parse(a))) : input[0];
  17. region = input[1].ToUpper();
  18. if (input.Length == 3)
  19. points = int.Parse(input[2]);
  20. }
  21. catch (Exception e)
  22. {
  23. Traceback.Write("At Team..ctor(string[]):");
  24. throw e;
  25. }
  26. }
  27. }
  28. }