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