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 }