示例#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;
 }
示例#2
0
文件: Filter.cs 项目: mchound/falyze
        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;
            }
        }
示例#3
0
文件: Filters.cs 项目: mchound/falyze
 public override bool Valid(Match match, Side side)
 {
     return this.Valid(this.GetTableRow(match, side).Position);
 }
示例#4
0
文件: Filters.cs 项目: mchound/falyze
 public override bool Valid(Match match, Side side)
 {
     return this.Valid(this.GetTableRow(match, side).GoalsFor);
 }
示例#5
0
文件: Filters.cs 项目: mchound/falyze
 public override bool Valid(Match match, Side side)
 {
     return side == Side.Home ? match.HomeTeamId == this.TeamId : match.AwayTeamId == this.TeamId;
 }
示例#6
0
文件: Filters.cs 项目: mchound/falyze
 public override bool Valid(Match match, Side side)
 {
     return this.Valid(this.GetTableRow(match, side).Round + 1);
 }
示例#7
0
文件: Filters.cs 项目: mchound/falyze
 public abstract override bool Valid(Match match, Side side);
示例#8
0
文件: Filter.cs 项目: mchound/falyze
 public abstract bool Valid(Match match, Side side);