private static void ShowLayer(List<Layer> layers, Layer newLayer) { int count = 0; foreach (Layer l in layers) if (l.Intersect(newLayer)) count += l.NumBlocks * l.Value; Console.WriteLine(count); }
private static void IntersectLayer(List<Layer> layers, Layer newLayer) { Queue<Layer> layersToProcess = new Queue<Layer>(); layersToProcess.Enqueue(newLayer); while (layersToProcess.Count > 0) { Layer currentLayer = layersToProcess.Dequeue(); foreach (Layer l in layers) { var newLayers = IntersectLayer(layers, newLayer); } } }
private static List<Layer> IntersectLayer(Layer layer1, Layer layer2) { return null; }
public bool Intersect(Layer rect) { return this.Left <= rect.Right && this.Right >= rect.Left && this.Top <= rect.Bottom && this.Bottom >= rect.Top; }