public void FindRepresentative() { // Find representative flop root Flop rep = MyFlop.Representative; if (IsRepresentative()) Representative = this; else //Representative = (FlopRoot)Parent.BranchesByIndex[Game.FlopLookup[rep.c1, rep.c2, rep.c3]]; Representative = (FlopRoot)Parent.BranchesByIndex[Flop.IndexOf(rep)]; }
protected override void CreateBranches() { Branches = new List<Node>(MyCommunity.Branches.Count); BranchesByIndex = new List<Node>(MyCommunity.BranchesByIndex.Count); int RootCount = 0; foreach (CommunityNode community in MyCommunity.BranchesByIndex) { PhaseRoot NewRoot = null; if (community != null) { if (Phase == BettingPhase.PreFlop) NewRoot = new FlopRoot(this, community, Spent, Pot, RootCount); else NewRoot = new PhaseRoot(this, community, Spent, Pot, RootCount); Branches.Add(NewRoot); } BranchesByIndex.Add(NewRoot); RootCount++; } }