public void setSortStrategy(SortStrategy strategy) { this.strategy = strategy; // permite mudar estratégia de ordenação }
public void SetSortStrategy(SortStrategy sortstrategy) { //TODO 「♠主処理カートリッジを入れ替えていろいろな処理を実行することができる」 this._sortstrategy = sortstrategy; }
public List <Player> GetTeamPlayers(string teamId) { List <Player> teamPlayers = DbLayer.ShowPlayers(teamId); return(SortStrategy.Sort(teamPlayers)); }
private SortStrategy strategy; // estratégia de ordenação public MyList(int [] elementos) { this.elementos = elementos; strategy = new BubbleSortStrategy(); // estratégia default: BubbleSort }
public List <Player> GetAllPlayers() { List <Player> players = DbLayer.Players(); return(SortStrategy.Sort(players)); }
public List <Team> GetAllTeams() { IEnumerable <Team> teams = DbLayer.Teams()?.Where(t => t.Id != "0"); return(SortStrategy.Sort(teams)); }
public DelegateStrategy(SortStrategy defaultStrategy) { _strategy = defaultStrategy; }
public void SetSortStrategy(SortStrategy sortStrategy) { _sortStrategy = sortStrategy; }
public List <Player> GetAllPlayers() { List <Player> players = DbLayer.PlayersAsync().Result; return(SortStrategy.Sort(players)); }
public void Sort(SortStrategy strategy) { strategy.Sort(this.list); }
public void SetSortStrategy(SortStrategy sortstrategy) { _sortstrategy = sortstrategy; }
// Constructors public void SetSortStrategy( SortStrategy sortstrategy ) { this.sortstrategy = sortstrategy; }
public ISortStrategy <T> Parse <T>(string sort) { const string SortStrategy = "SortStrategy"; var assembly = Assembly.GetExecutingAssembly(); var sortTypes = assembly.GetTypes() .Where(t => t.GetInterfaces().Contains(typeof(ISortStrategy <T>))) .ToArray(); var sortType = sortTypes .SingleOrDefault(t => t.Name.ToLower() == $"{sort.ToLower()}{SortStrategy.ToLower()}"); if (sortType == null) { return(null); } var sortStrategy = this.InjectServices <T>(sortType); return(sortStrategy); }
public void SetSortStrategy(SortStrategy sortstrategy) { this._sortstrategy = sortstrategy; }
public Sorter(SortStrategy sorter) { this.sorter = sorter; }
public Consumer(SortStrategy defaultStrategy) { this.strategy = defaultStrategy; }
public void Sort() { SortStrategy.Sort(List); }