public Square[] operate() { //create a unit for each group value, thread this Unit[] unitsOfAType = new Unit[n2]; int index = 0; foreach (Square[] sArr in groupedSquares) { unitsOfAType[index] = new Unit(sArr); index++; } for (int i = 0; i < n2; i++) { groupedSquares[i] = unitsOfAType[i].operate(); } //wait for all eliminations to complete //stitch the all squares back together and return that allSquares = stitchJaggedArray(groupedSquares); //check completion status XWing(); checkCompletion();//I need to make sure this is properly ordered changesMade = ChangesMade(unitsOfAType); return allSquares; }
private bool ChangesMade(Unit[] units) { foreach (Unit u in units) { if (u.changeStatus()) { return true; } } return false; }