예제 #1
0
        internal PiecePicker CreateStandardPicker()
        {
            PiecePicker picker;

            if (ClientEngine.SupportsEndgameMode)
            {
                picker = new EndGameSwitcher(new StandardPicker(), new EndGamePicker(),
                                             Torrent.PieceLength / Piece.BlockSize, this);
            }
            else
            {
                picker = new StandardPicker();
            }
            picker = new RandomisedPicker(picker);
            picker = new RarestFirstPicker(picker);
            picker = new PriorityPicker(picker);
            return(picker);
        }
예제 #2
0
        private PiecePicker CreateSlidingPicker(TorrentManager torrent)
        {
            PiecePicker picker;

            if (ClientEngine.SupportsEndgameMode)
            {
                picker = new EndGameSwitcher(new StandardPicker(), new EndGamePicker(), torrent.Torrent.PieceLength / Piece.BlockSize, torrent);
            }
            else
            {
                picker = new StandardPicker();
            }
            picker = new RandomisedPicker(picker);
            picker = new SlidingWindowPicker(picker);
            picker = new PriorityPicker(picker);

            return(picker);
        }