// その組み合わせの出場回数の合計を返す(設問1用) public int GetWeightForAnswer1(MultiMatch m) { return (this.GetWeightMatch(m) + this.GetWeightPair(m) + this.GetWeightPlayer(m)); }
// ペアの出場回数カウントアップ private void CountUpPair(MultiMatch m) { this.Pair[m.Match1.Pair1.Label]++; this.Pair[m.Match1.Pair2.Label]++; this.Pair[m.Match2.Pair1.Label]++; this.Pair[m.Match2.Pair2.Label]++; }
// 指定組み合わせの出場回数をカウントアップ public void CountUp(MultiMatch m) { this.CountUpMatch(m); this.CountUpSameCourtThree(m); this.CountUpSameCourtTwo(m); this.CountUpPair(m); this.CountUpPlayer(m); }
// ペアの出場回数合計 private int GetWeightPair(MultiMatch c) { return (this.Pair[c.Match1.Pair1.Label] + this.Pair[c.Match1.Pair2.Label] + this.Pair[c.Match2.Pair1.Label] + this.Pair[c.Match2.Pair2.Label]); }
// その組み合わせの出場回数の合計を返す public int GetWeight(MultiMatch m) { return (this.GetWeightMatch(m) + //this.GetWeightSameCourtThree(m) + this.GetWeightSameCourtTwo(m) + this.GetWeightPair(m) + this.GetWeightPlayer(m)); }
//public IEnumerable<Pair> GetPair() //{ // var hoge = this.Pair.OrderBy(x => x.Value).Select(x => x.Key); // foreach(var h in hoge) // { // } //} // 過去に顔を合わせた3人がコート上に存在しているか public bool isExistTwoMore(MultiMatch m) { if (m.Match1.TriosSameCourt.Any(x => this.SameCourtThree[x.Label] > 0)) { return(true); } if (m.Match2.TriosSameCourt.Any(x => this.SameCourtThree[x.Label] > 0)) { return(true); } return(false); }
// プレイヤーの出場回数合計 private int GetWeightPlayer(MultiMatch m) { return (this.Player[m.Match1.Pair1.Player1.Label] + this.Player[m.Match1.Pair1.Player2.Label] + this.Player[m.Match1.Pair2.Player1.Label] + this.Player[m.Match1.Pair2.Player2.Label] + this.Player[m.Match2.Pair1.Player1.Label] + this.Player[m.Match2.Pair1.Player2.Label] + this.Player[m.Match2.Pair2.Player1.Label] + this.Player[m.Match2.Pair2.Player2.Label]); }
// 同コートの2人出場回数カウントアップ private void CountUpSameCourtTwo(MultiMatch m) { m.Match1.PairsSameCourt.ToList().ForEach(x => this.SameCourtTwo[x.Label]++); m.Match2.PairsSameCourt.ToList().ForEach(x => this.SameCourtTwo[x.Label]++); }
// 同コードの3人出場回数カウントアップ private void CountUpSameCourtThree(MultiMatch m) { m.Match1.TriosSameCourt.ToList().ForEach(x => this.SameCourtThree[x.Label]++); m.Match2.TriosSameCourt.ToList().ForEach(x => this.SameCourtThree[x.Label]++); }
// 試合の出場回数カウントアップ private void CountUpMatch(MultiMatch m) { this.Match[m.Match1.Label]++; this.Match[m.Match2.Label]++; }
// 同コート内での2人組み合わせの出場回数合計 private int GetWeightSameCourtTwo(MultiMatch c) { return (c.Match1.PairsSameCourt.Sum(x => this.SameCourtTwo[x.Label]) + c.Match2.PairsSameCourt.Sum(x => this.SameCourtTwo[x.Label])); }
// 同コート内での3人組み合わせの出場回数合計 private int GetWeightSameCourtThree(MultiMatch c) { return (c.Match1.TriosSameCourt.Sum(x => this.SameCourtThree[x.Label]) + c.Match2.TriosSameCourt.Sum(x => this.SameCourtThree[x.Label])); }
// 指定試合の出場回数合計 private int GetWeightMatch(MultiMatch m) { return (this.Match[m.Match1.Label] + this.Match[m.Match2.Label]); }