Beispiel #1
0
 //private static bool ValidateMatch(this Match match, TeamFilters team1, TeamFilters team2)
 //{
 //    if (team1.Side == Side.Neutral)
 //    {
 //        return (team1.ValidateTeam(match, Side.Home) && team2.ValidateTeam(match, Side.Away)) || (team1.ValidateTeam(match, Side.Away) && team2.ValidateTeam(match, Side.Home));
 //    }
 //    else if (team1.Side == Side.Home)
 //    {
 //        return team1.ValidateTeam(match, Side.Home) && team2.ValidateTeam(match, Side.Away);
 //    }
 //    else
 //    {
 //        return team1.ValidateTeam(match, Side.Away) && team2.ValidateTeam(match, Side.Home);
 //    }
 //}
 private static bool ValidateTeam(this TeamFilters teamFilter, Match match, Side side)
 {
     foreach (var filter in teamFilter.GetFilters())
     {
         if (filter != null && !filter.Valid(match, side))
         {
             return false;
         }
     }
     return true;
 }
Beispiel #2
0
        protected TableRow GetTableRow(Match match, Side side)
        {
            if (side == Side.Neutral)
            {
                throw new ArgumentException("Side cannot be neutral when filtering", "side");
            }

            switch (this.Table)
            {
                case Side.Home:
                    return side == Side.Home ? match.HomeTeamHomeTable : match.AwayTeamHomeTable;
                case Side.Away:
                    return side == Side.Home ? match.HomeTeamAwayTable : match.AwayTeamAwayTable;
                default:
                    return side == Side.Home ? match.HomeTeamTable : match.AwayTeamTable;
            }
        }
Beispiel #3
0
 public override bool Valid(Match match, Side side)
 {
     return this.Valid(this.GetTableRow(match, side).Position);
 }
Beispiel #4
0
 public override bool Valid(Match match, Side side)
 {
     return this.Valid(this.GetTableRow(match, side).GoalsFor);
 }
Beispiel #5
0
 public override bool Valid(Match match, Side side)
 {
     return side == Side.Home ? match.HomeTeamId == this.TeamId : match.AwayTeamId == this.TeamId;
 }
Beispiel #6
0
 public override bool Valid(Match match, Side side)
 {
     return this.Valid(this.GetTableRow(match, side).Round + 1);
 }
Beispiel #7
0
 public abstract override bool Valid(Match match, Side side);
Beispiel #8
0
 public abstract bool Valid(Match match, Side side);