public List <PenaltyGroup> GetPenaltyGroupsForTeamAfterDate(int teamID, DateTime date)
        {
            var gps  = GetGroupPenaltiesForTeamAfterDate(teamID, date);
            var gbts = GetGroupBoxTimesForTeamAfterDate(teamID, date);

            List <PenaltyGroup> list = new List <PenaltyGroup>();

            foreach (KeyValuePair <int, List <Penalty> > group in gps)
            {
                var          penalties = group.Value;
                PenaltyGroup pg        = new PenaltyGroup
                {
                    Penalties = penalties,
                    PlayerID  = penalties.First().PlayerID,
                    GroupID   = group.Key
                };
                if (gbts.Any(bts => bts.Key == group.Key))
                {
                    pg.BoxTimes = gbts[group.Key];
                }
                else
                {
                    pg.BoxTimes = null;
                }
                list.Add(pg);
            }
            return(list);
        }
        private static IList <PenaltyGroup> BuildPenaltyGroups(Dictionary <int, List <Penalty> > gps, Dictionary <int, List <BoxTime> > gbts)
        {
            List <PenaltyGroup> list = new List <PenaltyGroup>();

            foreach (KeyValuePair <int, List <Penalty> > group in gps)
            {
                var          penalties = group.Value;
                PenaltyGroup pg        = new PenaltyGroup
                {
                    Penalties = penalties,
                    PlayerID  = penalties.First().PlayerID,
                    GroupID   = group.Key
                };
                if (gbts.Any(bts => bts.Key == group.Key))
                {
                    pg.BoxTimes = gbts[group.Key];
                }
                else
                {
                    pg.BoxTimes = null;
                }
                list.Add(pg);
            }
            return(list);
        }
Exemple #3
0
        public override int GetHashCode()
        {
            int hash = 17;

            hash = hash * 23 + PenaltyGroup.GetHashCode();
            hash = hash * 23 + BoxTime.GetHashCode();
            hash = hash * 23 + BoutID.GetHashCode();
            return(hash);
        }
Exemple #4
0
        public override bool Equals(object obj)
        {
            // If parameter is null return false.
            if (obj == null)
            {
                return(false);
            }

            // If parameter cannot be cast to Point return false.
            ConnectedBoxTime jpp = obj as ConnectedBoxTime;

            if ((System.Object)jpp == null)
            {
                return(false);
            }

            // Return true if the fields match:
            return(PenaltyGroup.Equals(jpp.PenaltyGroup) &&
                   BoxTime.Equals(jpp.BoxTime) &&
                   BoutID == jpp.BoutID);
        }