/// <summary> /// Claim will be made onto the big square /// </summary> /// <param name="fabric"></param> private void Stitch(Fabric fabric) { for (int x = 0; x < fabric.FabricSideX; x++) { for (int y = 0; y < fabric.FabricSideY; y++) { var index = fabric.LeftMargin + x + ((fabric.TopMargin + y) * Stride); var currentSquareValue = SquareValues[index]; if (currentSquareValue.HasValue) { if (OverlappingIDs.Contains(fabric.ID)) { OverlappingIDs.Remove(fabric.ID); } if (OverlappingIDs.Contains(currentSquareValue.Value)) { OverlappingIDs.Remove(currentSquareValue.Value); } currentSquareValue = 0; } else { currentSquareValue = fabric.ID; } SquareValues[index] = currentSquareValue; } } }
public int NoNOverlappingID() { return(OverlappingIDs.First()); }