Example #1
0
        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);
        }
Example #2
0
        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);
                }
            }
        }
Example #3
0
 private static List<Layer> IntersectLayer(Layer layer1, Layer layer2)
 {
     return null;
 }
Example #4
0
 public bool Intersect(Layer rect)
 {
     return this.Left <= rect.Right && this.Right >= rect.Left &&
         this.Top <= rect.Bottom && this.Bottom >= rect.Top;
 }