예제 #1
0
 public void setSortStrategy(SortStrategy strategy)
 {
     this.strategy = strategy; // permite mudar estratégia de ordenação
 }
예제 #2
0
 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));
        }
예제 #4
0
    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));
        }
예제 #7
0
 public DelegateStrategy(SortStrategy defaultStrategy)
 {
     _strategy = defaultStrategy;
 }
예제 #8
0
 public void SetSortStrategy(SortStrategy sortStrategy)
 {
     _sortStrategy = sortStrategy;
 }
예제 #9
0
        public List <Player> GetAllPlayers()
        {
            List <Player> players = DbLayer.PlayersAsync().Result;

            return(SortStrategy.Sort(players));
        }
예제 #10
0
 public void Sort(SortStrategy strategy)
 {
     strategy.Sort(this.list);
 }
예제 #11
0
 public void SetSortStrategy(SortStrategy sortstrategy)
 {
     _sortstrategy = sortstrategy;
 }
예제 #12
0
 // Constructors
 public void SetSortStrategy( SortStrategy sortstrategy )
 {
   this.sortstrategy = sortstrategy;
 }
예제 #13
0
        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);
        }
예제 #14
0
 public void SetSortStrategy(SortStrategy sortstrategy)
 {
     this._sortstrategy = sortstrategy;
 }
 public Sorter(SortStrategy sorter)
 {
     this.sorter = sorter;
 }
예제 #16
0
 public Consumer(SortStrategy defaultStrategy)
 {
     this.strategy = defaultStrategy;
 }
예제 #17
0
 public void Sort()
 {
     SortStrategy.Sort(List);
 }