public void Setup() { id.BitField.SetAll(true); tester = new TestPicker(); picker = new PriorityPicker(tester); picker.Initialise(rig.Manager.Bitfield, rig.Torrent.Files, new List <Piece>()); foreach (TorrentFile file in rig.Torrent.Files) { file.Priority = Priority.Normal; } }
public void Setup() { rig = TestRig.CreateMultiFile(); id = new PeerId(new Peer(new string('a', 20), new Uri("tcp://BLAH")), rig.Manager); id.BitField.SetAll(true); tester = new TestPicker(); picker = new PriorityPicker(tester); picker.Initialise(rig.Manager.Bitfield, rig.Torrent.Files, new List <Piece>()); foreach (TorrentFile file in rig.Torrent.Files) { file.Priority = Priority.Normal; } }
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); }