public static void SetIsNew(ISpread<Blob> blobs, ISpread<Blob> pBlobs) { if (pBlobs.SliceCount == 0) { for (var i = 0; i < blobs.SliceCount; i++) { blobs[i] = new Blob{Position = blobs[i].Position, HitId = blobs[i].HitId, Id = blobs[i].Id, IsNew = true}; } } else { for (var i = 0; i < blobs.SliceCount; i++) { //TODO: Proper new blob detection blobs[i] = new Blob { Position = blobs[i].Position, HitId = blobs[i].HitId, Id = blobs[i].Id, IsNew = pBlobs.All(blob => blob.Id != blobs[i].Id)}; } } pBlobs.SliceCount = blobs.SliceCount; pBlobs.AssignFrom(blobs); }
public static void SetIsNew(ISpread <Blob> blobs, ISpread <Blob> pBlobs) { if (pBlobs.SliceCount == 0) { for (var i = 0; i < blobs.SliceCount; i++) { blobs[i] = new Blob { Position = blobs[i].Position, HitId = blobs[i].HitId, Id = blobs[i].Id, IsNew = true }; } } else { for (var i = 0; i < blobs.SliceCount; i++) { //TODO: Proper new blob detection blobs[i] = new Blob { Position = blobs[i].Position, HitId = blobs[i].HitId, Id = blobs[i].Id, IsNew = pBlobs.All(blob => blob.Id != blobs[i].Id) }; } } pBlobs.SliceCount = blobs.SliceCount; pBlobs.AssignFrom(blobs); }