internal static void Init() { foreach (var line in TeamPlayersRecord.Records) { AllPlayers.Add(new Player(line.PlayerName, Team.FindTeamByName(line.Team), (Position)Enum.Parse(typeof(Position), line.Position), line.Suspension)); } foreach (Team t in Team.Teams) { AllPlayers.Add(new Player(t.Name, t, Position.DEF, 0)); } }
public static Team GetOppTeam(this object record) { FieldInfo p = record.GetType().GetField("VsTeam"); return(Team.FindTeamByName((string)p.GetValue(record))); }