Exemplo n.º 1
0
    private void Awake()
    {
        DefineSingleton(this);

        _player    = FindObjectOfType <Player>();
        _endMarker = FindObjectOfType <EndMarker>();
    }
Exemplo n.º 2
0
        public override void OnDraw(object dc, double zoom)
        {
            var canvas = dc as SKCanvas;

            if (Line.IsStroked)
            {
                if (Style.LineStyle.IsCurved)
                {
                    canvas.DrawPath(CurveGeometry, Stroke);
                }
                else
                {
                    canvas.DrawLine(P0, P1, Stroke);
                }

                if (Style.StartArrowStyle.ArrowType != ArrowType.None)
                {
                    StartMarker?.Draw(dc);
                }

                if (Style.EndArrowStyle.ArrowType != ArrowType.None)
                {
                    EndMarker?.Draw(dc);
                }
            }
        }
Exemplo n.º 3
0
        private void UpdateMarkers()
        {
            double x1 = Line.Start.X;
            double y1 = Line.Start.Y;
            double x2 = Line.End.X;
            double y2 = Line.End.Y;

            Line.GetMaxLength(ref x1, ref y1, ref x2, ref y2);

            if (Style.StartArrowStyle.ArrowType != ArrowType.None)
            {
                double a1 = Math.Atan2(y1 - y2, x1 - x2);
                StartMarker = CreatArrowMarker(x1, y1, a1, Style.StartArrowStyle);
                StartMarker.UpdateStyle();
                P0 = (StartMarker as Marker).Point;
            }
            else
            {
                StartMarker = null;
                P0          = new SKPoint((float)x1, (float)y1);
            }

            if (Style.EndArrowStyle.ArrowType != ArrowType.None)
            {
                double a2 = Math.Atan2(y2 - y1, x2 - x1);
                EndMarker = CreatArrowMarker(x2, y2, a2, Style.EndArrowStyle);
                EndMarker.UpdateStyle();
                P1 = (EndMarker as Marker).Point;
            }
            else
            {
                EndMarker = null;
                P1        = new SKPoint((float)x2, (float)y2);
            }
        }
Exemplo n.º 4
0
        public override void OnDraw(object dc, double zoom)
        {
            var context = dc as AM.DrawingContext;

            if (Line.IsStroked)
            {
                if (Style.LineStyle.IsCurved)
                {
                    context.DrawGeometry(null, Stroke, CurveGeometry);
                }
                else
                {
                    context.DrawLine(Stroke, P0, P1);
                }

                if (Style.StartArrowStyle.ArrowType != ArrowType.None)
                {
                    StartMarker?.Draw(dc);
                }

                if (Style.EndArrowStyle.ArrowType != ArrowType.None)
                {
                    EndMarker?.Draw(dc);
                }
            }
        }
Exemplo n.º 5
0
 public ConnectionParameters(string portName, int baudRate, int dataBitsCount, Parity parity, Handshake handshakeType, StopBits stopBitsType, EndMarker endMarker)
 {
     PortName = portName;
     BaudRate = baudRate;
     DataBits = dataBitsCount;
     Parity = parity;
     Handshake = handshakeType;
     StopBits = stopBitsType;
     EndMarker = endMarker;
 }
Exemplo n.º 6
0
        public override void UpdateStyle()
        {
            base.UpdateStyle();

            if (Style.StartArrowStyle.ArrowType != ArrowType.None)
            {
                StartMarker?.UpdateStyle();
            }

            if (Style.EndArrowStyle.ArrowType != ArrowType.None)
            {
                EndMarker?.UpdateStyle();
            }
        }
Exemplo n.º 7
0
        private void gmap_OnMarkerClick(GMapMarker item, MouseEventArgs e)
        {
            StationMaker marker = item as StationMaker;

            if (_currentKeyDown == Keys.A)
            {
                if (markerA != null)
                {
                    markersOverlay.Markers.Remove(markerA);
                }
                _startStation = marker.StationId;
                StartMark mark = new StartMark(marker.Position.Lat, marker.Position.Lng);
                mark.StationId = marker.StationId;
                markersOverlay.Markers.Add(mark);
                markerA = mark;
            }
            else if (_currentKeyDown == Keys.S)
            {
                if (markerA != null)
                {
                    markersOverlay.Markers.Remove(markerB);
                }
                _endStation = marker.StationId;
                EndMarker mark = new EndMarker(marker.Position.Lat, marker.Position.Lng);
                mark.StationId = marker.StationId;
                markersOverlay.Markers.Add(mark);
                markerB = mark;
            }
            else if (_currentKeyDown == Keys.D)
            {
                if (marker == null)
                {
                    return;
                }
                _startStation = marker.StationId;
                StartMark mark = new StartMark(marker.Position.Lat, marker.Position.Lng);
                mark.StationId = marker.StationId;
                markersOverlay.Markers.Add(mark);
                markerA = mark;
                showTreePathAtStation(new List <int>(new int[] { _startStation }), 1, new List <int>());
            }
            else
            {
                _startStation = 0;
                _endStation   = 0;
            }
        }
Exemplo n.º 8
0
 public static string EndMarkerText(EndMarker endMarker)
 {
     return(endMarkerStrings[(int)endMarker]);
 }
Exemplo n.º 9
0
 public TextLine(string text, EndMarker endMarker)
 {
     this.Text      = text;
     this.EndMarker = endMarker;
 }
Exemplo n.º 10
0
 public EndMarkerMenuItem(EndMarker type)
 {
     this.type = type;
 }
Exemplo n.º 11
0
 public static string EndMarkerText(EndMarker endMarker)
 {
     return endMarkerStrings[(int)endMarker];
 }
Exemplo n.º 12
0
 public TextLine(string text, EndMarker endMarker)
 {
     this.Text = text;
     this.EndMarker = endMarker;
 }