using System.Collections.Generic; using System.Linq; public class SkillLimitUpperCountFromNewestFilter : ISkillSelectFilter { private int _limitCount; public SkillLimitUpperCountFromNewestFilter(int limitCount) { _limitCount = limitCount; } public int CalcCount(SkillOptionValue option) { return -1; } public IEnumerable Filtering(IEnumerable cards, SkillOptionValue option, SkillConditionCheckerOption checkerOption) { IEnumerable enumerable = cards.Except(checkerOption.SkillDrewCards.Cast()); if (enumerable.Count() < _limitCount) { return enumerable; } return enumerable.Skip(enumerable.Count() - _limitCount); } }