private void SetSolutionFromIndex(int index) { if (index == 0) { solution = wireSolution.Wire1; } else if (index == 1) { solution = wireSolution.Wire2; } else if (index == 2) { solution = wireSolution.Wire3; } else if (index == 3) { solution = wireSolution.Wire4; } else if (index == 4) { solution = wireSolution.Wire5; } else if (index == 5) { solution = wireSolution.Wire6; } else { solution = wireSolution.NotEnoughWires; } }
public void ResetWires() { for (int i = 0; i < wires.Count; ++i) { wires[i] = wireColor.NoWire; } solution = wireSolution.NotEnoughWires; displayOddSerialWarning = false; solutionMessage = ""; }
public WiresModule(BombInfo info) { wires = new List <wireColor>(); for (int i = 0; i < MAX_WIRES; ++i) { wires.Add(wireColor.NoWire); } solution = wireSolution.NotEnoughWires; displayOddSerialWarning = false; serialIsOdd = info.LastSerialDigitIsOdd; }
// Solving logic private void CalculateSolution() { displayOddSerialWarning = false; switch (GetNumberOfWires()) { case 3: { ThreeWireLogic(); break; } case 4: { FourWireLogic(); break; } case 5: { FiveWireLogic(); break; } case 6: { SixWireLogic(); break; } default: { solution = wireSolution.NotEnoughWires; solutionMessage = ""; break; } } }