예제 #1
0
        private bool CheckDefault()
        {
            DsFilter defaultFilter = new DsFilter();

            if (MinDuration == defaultFilter.MinDuration &&
                MaxDuration == defaultFilter.MaxDuration &&
                MinArmy == defaultFilter.MinArmy &&
                MinIncome == defaultFilter.MinIncome &&
                MaxLeaver == defaultFilter.MaxLeaver &&
                MinKills == defaultFilter.MinKills &&
                PlayerCount == defaultFilter.PlayerCount &&
                Mid == defaultFilter.Mid &&
                !(GameModes.Except(new List <int>()
            {
                (int)Gamemode.Commanders, (int)Gamemode.CommandersHeroic
            }).Any() ||
                  (new List <int>()
            {
                (int)Gamemode.Commanders, (int)Gamemode.CommandersHeroic
            }).Except(GameModes).Any()) &&
                !Players.Any() &&
                DefaultTime
                )
            {
                return(true);
            }
            return(false);
        }
예제 #2
0
        public void SetDefault()
        {
            DsFilter defaultFilter = new DsFilter();

            MinDuration = defaultFilter.MinDuration;
            MaxDuration = defaultFilter.MaxDuration;
            MinArmy     = defaultFilter.MinArmy;
            MinIncome   = defaultFilter.MinIncome;
            MaxLeaver   = defaultFilter.MaxLeaver;
            MinKills    = defaultFilter.MinKills;
            PlayerCount = defaultFilter.PlayerCount;
            Mid         = defaultFilter.Mid;
            GameEnts    = DSData.gamemodes.Select(s => new EditEnt()
            {
                ent = s, selected = false
            }).ToList();
            GameEnts.First(f => f.ent == "GameModeCommanders").selected       = true;
            GameEnts.First(f => f.ent == "GameModeCommandersHeroic").selected = true;
            GameModes = new List <int>()
            {
                (int)Gamemode.Commanders, (int)Gamemode.CommandersHeroic
            };
            if (PlayerEnts != null && PlayerEnts.Any())
            {
                PlayerEnts.ForEach(f => f.selected = false);
            }
            Players = new List <string>();
        }