public static void InitializeCircuit() { if (Settings.Debug) { try { System.IO.Directory.Delete("debug/CircuitParts", true); } catch { } System.IO.Directory.CreateDirectory("debug/CircuitParts"); IO.SaveEngine.SaveAll("debug/CircuitParts/autosave.sav"); } SubCircuits.Clear(); for (int i = 0; i < Joints.Count; i++) { Joints[i].IsInSubCircuit = false; } for (int i = 0; i < Wires.Count; i++) { Wires[i].IsUpdated = false; } for (int i = 0; i < Joints.Count; i++) { if (!Joints[i].IsInSubCircuit) { if (Settings.Debug) { System.IO.Directory.CreateDirectory("debug/CircuitParts/" + SubCircuits.Count.ToString()); } CircuitPart c = new CircuitPart(); c.Init(Joints[i]); SubCircuits.Add(c); } } for (int i = 0; i < Joints.Count; i++) { Joints[i].IsInSubCircuit = false; } for (int i = 0; i < Wires.Count; i++) { Wires[i].IsUpdated = false; } }
public static void InitializeCircuit() { if (Settings.Debug) { try { System.IO.Directory.Delete("debug/CircuitParts", true); } catch { } System.IO.Directory.CreateDirectory("debug/CircuitParts"); IO.SaveEngine.SaveAll("debug/CircuitParts/autosave.sav"); } SubCircuits.Clear(); for (int i = 0; i < Joints.Count; i++) { Joints[i].IsInSubCircuit = false; } for (int i = 0; i < Wires.Count; i++) { Wires[i].IsUpdated = false; } for (int i = 0; i < Joints.Count; i++) { if (!Joints[i].IsInSubCircuit) { if (Settings.Debug) System.IO.Directory.CreateDirectory("debug/CircuitParts/" + SubCircuits.Count.ToString()); CircuitPart c = new CircuitPart(); c.Init(Joints[i]); SubCircuits.Add(c); } } for (int i = 0; i < Joints.Count; i++) { Joints[i].IsInSubCircuit = false; } for (int i = 0; i < Wires.Count; i++) { Wires[i].IsUpdated = false; } }