public PlayerLister( string catCode, bool faOnly, [Optional] string fantasyLeague, [Optional] bool startersOnly, [Optional] IKeepTheTime timekeeper ) { if (timekeeper != null) { TimeKeeper = timekeeper; } PrimariesOnly = true; ActivesOnly = true; FreeAgentsOnly = false; StartersOnly = startersOnly; PlayerList = new ArrayList(); Folder = string.Empty; var ds = Utility.TflWs.GetPlayers(catCode); var dt = ds.Tables[0]; foreach (DataRow dr in dt.Rows) { var p = new NFLPlayer(dr, fantasyLeague); var bAdd = !faOnly || p.IsFreeAgent(); if (ActivesOnly) { bAdd = bAdd && p.IsActive(); } if (StartersOnly) { bAdd = bAdd && p.IsStarter(); } if (PlayoffsOnly) { bAdd = bAdd && p.IsPlayoffBound(); } if (PrimariesOnly) { bAdd = bAdd && !p.IsItalic(); // dont want FB, TE or punters } if (OnesAndTwosOnly) { bAdd = bAdd && p.IsOneOrTwo(); } if (catCode.Equals("2")) // there is a lack of RBs { bAdd = bAdd && p.IsOneOrTwo(); } if (bAdd) { PlayerList.Add(p); } } WeeksToGoBack = Constants.K_WEEKS_IN_A_SEASON; // default }
public PlayerLister(string catCode, bool faOnly, [Optional] string fantasyLeague, [Optional] bool startersOnly ) { PrimariesOnly = true; ActivesOnly = true; FreeAgentsOnly = false; StartersOnly = startersOnly; PlayerList = new ArrayList(); var ds = Utility.TflWs.GetPlayers(catCode); var dt = ds.Tables[0]; foreach (DataRow dr in dt.Rows) { var p = new NFLPlayer(dr, fantasyLeague); var bAdd = !(faOnly) || p.IsFreeAgent(); if (ActivesOnly) { bAdd = (bAdd) && p.IsActive(); } if (StartersOnly) { bAdd = (bAdd) && p.IsStarter(); } if (PlayoffsOnly) { bAdd = (bAdd) && p.IsPlayoffBound(); } if (PrimariesOnly) { bAdd = (bAdd) && !p.IsItalic(); // dont want FB, TE or punters } if (OnesAndTwosOnly) { bAdd = (bAdd) && p.IsOneOrTwo(); } if (bAdd) { PlayerList.Add(p); } } WeeksToGoBack = Constants.K_WEEKS_IN_A_SEASON; // default }
public PlayerLister(string catCode, bool faOnly, [Optional] string fantasyLeague, [Optional] bool startersOnly, [Optional] IKeepTheTime timekeeper ) { if (timekeeper != null) TimeKeeper = timekeeper; PrimariesOnly = true; ActivesOnly = true; FreeAgentsOnly = false; StartersOnly = startersOnly; PlayerList = new ArrayList(); Folder = string.Empty; var ds = Utility.TflWs.GetPlayers(catCode); var dt = ds.Tables[0]; foreach (DataRow dr in dt.Rows) { var p = new NFLPlayer(dr, fantasyLeague); var bAdd = !(faOnly) || p.IsFreeAgent(); if (ActivesOnly) bAdd = (bAdd) && p.IsActive(); if (StartersOnly) bAdd = (bAdd) && p.IsStarter(); if (PlayoffsOnly) bAdd = (bAdd) && p.IsPlayoffBound(); if (PrimariesOnly) bAdd = (bAdd) && !p.IsItalic(); // dont want FB, TE or punters if (OnesAndTwosOnly) bAdd = (bAdd) && p.IsOneOrTwo(); if (bAdd) PlayerList.Add(p); } WeeksToGoBack = Constants.K_WEEKS_IN_A_SEASON; // default }
public void Collect( string catCode, string sPos, string fantasyLeague, [Optional] string rookieYr) { DumpParameters(); DataSet ds; if (string.IsNullOrEmpty(sPos)) { ds = Utility.TflWs.GetPlayers(catCode); } else { ds = sPos.Equals("KR") ? Utility.TflWs.GetReturners() : Utility.TflWs.GetPlayers( catCode, sPos, role: OnesAndTwosOnly? null : "*", rookieYr: rookieYr); } var dt = ds.Tables[0]; foreach (DataRow dr in dt.Rows) { if (dr.RowState == DataRowState.Deleted) { continue; } var p = new NFLPlayer(dr, fantasyLeague); if (p.PlayerName == "Jonathan Taylor") { System.Console.WriteLine("Testplayer"); } var bAdd = true; if (FreeAgentsOnly) { bAdd = p.IsFreeAgent(); } if (PlayoffsOnly) { bAdd = bAdd && p.IsPlayoffBound(); } bAdd = bAdd && p.IsFantasyOffence(); bAdd = bAdd && p.IsActive(); if (StartersOnly) { bAdd = bAdd && p.IsStarter(); if (sPos.Equals("RB")) { bAdd = p.IsOneOrTwo(); } } if (OnesAndTwosOnly) { bAdd = bAdd && p.IsOneOrTwo(); } if (bAdd) { AnnounceAdd( catCode, sPos, p); PlayerList.Add(p); #if DEBUG2 // speed up things if (PlayerList.Count > 2) { break; } #endif if (StartersOnly) { if (sPos != null) { if (sPos != "WR") { Tc.TickOff(p.TeamCode, sPos); // there r 2 WRs } } } } else { AnnounceSkip( catCode, sPos, p); } } AnnounceTotal(sPos); }
public void Collect(string catCode, string sPos, string fantasyLeague) { Clear(); DataSet ds; if (string.IsNullOrEmpty(sPos)) { ds = Utility.TflWs.GetPlayers(catCode); } else { ds = sPos.Equals("KR") ? Utility.TflWs.GetReturners() : Utility.TflWs.GetPlayers(catCode, sPos); } var dt = ds.Tables[0]; foreach (DataRow dr in dt.Rows) { if (dr.RowState != DataRowState.Deleted) { var p = new NFLPlayer(dr, fantasyLeague); var bAdd = true; if (FreeAgentsOnly) { bAdd = p.IsFreeAgent(); } if (PlayoffsOnly) { bAdd = (bAdd) && p.IsPlayoffBound(); } bAdd = (bAdd) && p.IsFantasyOffence(); bAdd = (bAdd) && p.IsActive(); if (StartersOnly) { bAdd = (bAdd) && p.IsStarter(); } if (OnesAndTwosOnly) { bAdd = (bAdd) && p.IsOneOrTwo(); } if (bAdd) { AnnounceAdd(catCode, sPos, p); PlayerList.Add(p); if (StartersOnly) { if (sPos != null) { if (sPos != "WR") { Tc.TickOff(p.TeamCode, sPos); // there r 2 WRs } } } } } } AnnounceTotal(sPos); }
public void Collect( string catCode, string sPos, string fantasyLeague, [Optional] string rookieYr ) { DumpParameters(); DataSet ds; if (string.IsNullOrEmpty(sPos)) ds = Utility.TflWs.GetPlayers(catCode); else ds = sPos.Equals("KR") ? Utility.TflWs.GetReturners() : Utility.TflWs.GetPlayers( catCode, sPos, role:OnesAndTwosOnly? null : "*", rookieYr:rookieYr); var dt = ds.Tables[0]; foreach (DataRow dr in dt.Rows) { if (dr.RowState == DataRowState.Deleted) continue; var p = new NFLPlayer(dr, fantasyLeague); var bAdd = true; if (FreeAgentsOnly) bAdd = p.IsFreeAgent(); if (PlayoffsOnly) bAdd = (bAdd) && p.IsPlayoffBound(); bAdd = (bAdd) && p.IsFantasyOffence(); bAdd = (bAdd) && p.IsActive(); if (StartersOnly) bAdd = (bAdd) && p.IsStarter(); if (OnesAndTwosOnly) bAdd = (bAdd) && p.IsOneOrTwo(); if (bAdd) { AnnounceAdd(catCode, sPos, p); PlayerList.Add(p); #if DEBUG2 // speed up things if (PlayerList.Count > 2) break; #endif if (StartersOnly) { if (sPos != null) if (sPos != "WR") Tc.TickOff(p.TeamCode, sPos); // there r 2 WRs } } } AnnounceTotal(sPos); }