/** * 找出每一輪的場次,以及場次的選手或隊伍(如果已經知道的話)。規則為: * 1. 各別針對 div1 和 div2, * 第一輪處理: * 對於 div1 中的每個選手或隊伍: * 如果是輪空,就直接放到第二輪候選。 * 如果沒有輪空,應該與下一個一起,每兩個 Candidate 可以建立一個 Match,紀錄該 match 中的兩個選手或隊伍。然後在第二輪建立一個候選人,來自這個 match。 * * @memberof SingleElimination */ public void startMatching() { this.markEmptyCandidates(); //標示出要輪空的選手位置 SingleEliminationMatchesCreator semc = new SingleEliminationMatchesCreator(this.div1, this.div2); semc.createMatches(); this._semc = semc; }
public SingleElimination(int count) { this.teamCount = count; this.div1 = new List <Candidate>(); this.div2 = new List <Candidate>(); this.all = new List <Candidate>(); this.initplayer(); this.roundCount = Util.findModePower(this.teamCount, 1); this.modeCount = (int)Math.Pow(2, this.roundCount); //參賽隊伍數對應的2的自乘數 this.calculateEmptyCount(); this._semc = new SingleEliminationMatchesCreator(this.div1, this.div2); }