Beispiel #1
0
 public Point MapPoint(DemoMinifier.Models.Vector vec)
 {
     return(new Point(
                (int)((vec.X - mapX) / scale),
                (int)((mapY - vec.Y) / scale)
                ));
 }
Beispiel #2
0
        public void SmokeEnded(DemoMinifier.Models.Vector position)
        {
            if (smokes.Count == 0)
            {
                return;
            }

            SmokeCircle circle = smokes.Dequeue();

            canvas.Children.Remove(circle);
        }
Beispiel #3
0
        public void FireEnded(DemoMinifier.Models.Vector position)
        {
            if (molotovs.Count == 0)
            {
                return;
            }

            FireCircle circle = molotovs.Dequeue();

            canvas.Children.Remove(circle);
        }
Beispiel #4
0
        public void SmokeStarted(DemoMinifier.Models.Vector position)
        {
            SmokeCircle circle = new SmokeCircle();

            canvas.Children.Add(circle);
            smokes.Enqueue(circle);

            Point  radarPosition = MapPoint(position);
            double radius        = (MapPoint(position) - MapPoint(position + new DemoMinifier.Models.Vector(288, 0, 0))).Length;

            circle.SetRadius(radius);
            double left = radarPosition.X - radius / 2d;
            double top  = radarPosition.Y - radius / 2d;

            Canvas.SetLeft(circle, left);
            Canvas.SetTop(circle, top);
        }