示例#1
0
 /// <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;
         }
     }
 }
示例#2
0
 public int NoNOverlappingID()
 {
     return(OverlappingIDs.First());
 }