private void init() { MoveNode.GradeNode currentNode = lowestNode; while (true) { if (currentNode is RootNode.RootGrade) { break; } int[] pegs = lowestNode.MoveNode.SinglePegs; if (currentNode.gradeWhite == 0 && currentNode.gradeBlack == 0) { foreach (int peg in pegs) { colorFalse[peg] = true; } } if (currentNode.gradeWhite + currentNode.gradeBlack == config.pegs) { for (int i = 0; i < colorFalse.Length; i++) { colorFalse[i] = true; } foreach (int peg in pegs) { colorFalse[peg] = false; } } foreach (int peg in pegs) { colorUsed[peg] = true; } currentNode = currentNode.ParentGradeNode; } }
public SymmetryEnvironment(MoveNode.GradeNode lowestNode) { this.lowestNode = lowestNode; config = lowestNode.MoveNode.config; colorFalse = new bool[config.colors]; colorUsed = new bool[config.colors]; init(); }