private void AddWireCell(int x, int y) { WireCellLookup wireCellLookup = new WireCellLookup { X = x, Y = y }; WireCell wireCell = new WireCell { X = x, Y = y, WireNumber = currentWireNumber }; bool isCrossing = wireCells.TryAdd(wireCellLookup, wireCell); if (!isCrossing && !IsSameWire(wireCellLookup)) { Logger.Log($"Intersection at X: {x} and Y: {y}."); wireCells[wireCellLookup].IsIntersection = true; } }
private bool IsSameWire(WireCellLookup wireCellLookup) { return(wireCells[wireCellLookup].WireNumber == currentWireNumber); }