public NFLPlayer(string fName, string lName, NFLPosition pos, NFLTeam nflTeam) { FirstName = fName; LastName = lName; Position = pos; NFLTeam = nflTeam; }
public List<NFLTeam> PopulateNFLTeams() { NFLTeam currentTeam; List<NFLTeam> allTeams = new List<NFLTeam>(); DeleteAllItemsByType(typeof(NFLTeam)); string[] allTeamInfo = new string[]{"Tennessee Titans TEN #00295b #3274a2 AFC South 4", "New England Patriots NE #00295b #da2128 AFC East 4", "Carolina Panthers CAR #000000 #009ad9 NFC South 5", "Miami Dolphins MIA #006265 #fb4f14 AFC East 5", "Minnesota Vikings MIN #4f2683 #ffc52f NFC North 5", "New York Jets NYJ #29433a #ffffff AFC East 5", "Dallas Cowboys DAL #00295b #b0b7bc NFC East 6", "Oakland Raiders OAK #000000 #bcc4c9 AFC West 6", "St. Louis Rams STL #00295b #c8aa76 NFC West 6", "Tampa Bay Buccaneers TB #000000 #d50a0a NFC South 6", "Chicago Bears CHI #040911 #c83803 NFC North 7", "Cincinnati Bengals CIN #000000 #f04e23 AFC North 7", "Denver Broncos DEN #001f53 #f15623 AFC West 7", "Green Bay Packers GB #2a433a #ffc20e NFC North 7", "Buffalo Bills BUF #005496 #DA2128 AFC East 8", "Jacksonville Jaguars JAX #116879 #d7a22a AFC South 8", "Philadelphia Eagles PHI #004c54 #ffffff NFC East 8", "Washington Redskins WAS #691b11 #ffc20e NFC East 8", "Arizona Cardinals ARI #9b243e #ffffff NFC West 9", "Baltimore Ravens BAL #42205d #ffffff AFC North 9", "Detroit Lions DET #006db0 #ffffff NFC North 9", "Houston Texans HOU #00123f #c9243f AFC South 9", "Kansas City Chiefs KC #e31837 #ffffff AFC West 9", "Seattle Seahawks SEA #01152d #69bd28 NFC West 9", "Atlanta Falcons ATL #000000 #a71930 NFC South 10", "Indianapolis Colts IND #002245 #ffffff AFC South 10", "San Diego Chargers SD #00295b #ffc20e AFC West 10", "San Francisco 49ers SF #c9243f #c8aa76 NFC West 10", "Cleveland Browns CLE #311d00 #ff3c00 AFC North 11", "New Orleans Saints NO #000000 #9f8958 NFC South 11", "New York Giants NYG #0B2265 #A71930 NFC East 11", "Pittsburgh Steelers PIT #000000 #FFB612 AFC North 11" }; int iByeWeek; foreach (string teamInfo in allTeamInfo) { var TeamParts = teamInfo.Split('\t'); if (!Int32.TryParse(TeamParts[7], out iByeWeek)) iByeWeek = -1; // TODO: Properly handle error NFLDivision division; if (TeamParts[5] == "NFC" && TeamParts[6] == "North") division = NFLDivision.NFCNorth; else if (TeamParts[5] == "NFC" && TeamParts[6] == "South") division = NFLDivision.NFCSouth; else if (TeamParts[5] == "NFC" && TeamParts[6] == "East") division = NFLDivision.NFCEast; else if (TeamParts[5] == "NFC" && TeamParts[6] == "West") division = NFLDivision.NFCWest; else if (TeamParts[5] == "AFC" && TeamParts[6] == "North") division = NFLDivision.AFCNorth; else if (TeamParts[5] == "AFC" && TeamParts[6] == "South") division = NFLDivision.AFCSouth; else if (TeamParts[5] == "AFC" && TeamParts[6] == "East") division = NFLDivision.AFCEast; else if (TeamParts[5] == "AFC" && TeamParts[6] == "West") division = NFLDivision.AFCWest; else division = NFLDivision.NFCNorth; currentTeam = new NFLTeam() { City = TeamParts[0], Mascott = TeamParts[1], Abbreviation = TeamParts[2], PrimaryColor = ColorTranslator.FromHtml(TeamParts[3]), SecondaryColor = ColorTranslator.FromHtml(TeamParts[4]), Division = division, ByeWeek = iByeWeek }; allTeams.Add(currentTeam); DataContainer.Store(currentTeam); } DataContainer.Commit(); return allTeams; }