示例#1
0
        //If player attended most recent Monday game
        public bool IsPlayerAttendedThisWeekMondayGame(DateTime fridayGameDate, Player player)
        {
            List <Pool> mondayPools = Pools.FindAll(mondayPool => mondayPool.DayOfWeek == DayOfWeek.Monday);

            foreach (Pool pool in mondayPools)
            {
                Game mostRecentGame = pool.Games.OrderByDescending(game => game.Date).ToList <Game>().Find(game => game.Date < fridayGameDate);
                if (mostRecentGame == null || mostRecentGame.Date.AddDays(7) < fridayGameDate.Date)
                {
                    continue;
                }
                if (mostRecentGame.AllPlayers.Items.Exists(attendee => attendee.PlayerId == player.Id && attendee.Status == InOutNoshow.In))
                {
                    return(true);
                }
            }
            return(false);
        }
示例#2
0
 public List <Pool> FindMondayPools()
 {
     return(Pools.FindAll(p => p.DayOfWeek == DayOfWeek.Monday));
 }