示例#1
0
        private void RebuildMapComponents()
        {
            if (!mapSink.IsOpened)
            {
                return;
            }

            foreach (var val in tmpWayPointComponents)
            {
                wayPointComponents.Remove(val);
            }

            foreach (WaypointMapComponent comp in wayPointComponents)
            {
                comp.Dispose();
            }

            wayPointComponents.Clear();

            for (int i = 0; i < ownWaypoints.Count; i++)
            {
                WaypointMapComponent comp = new WaypointMapComponent(i, ownWaypoints[i], this, api as ICoreClientAPI);

                wayPointComponents.Add(comp);
            }

            wayPointComponents.AddRange(tmpWayPointComponents);
        }
示例#2
0
        public void AddTemporaryWaypoint(Waypoint waypoint)
        {
            WaypointMapComponent comp = new WaypointMapComponent(ownWaypoints.Count, waypoint, this, api as ICoreClientAPI);

            wayPointComponents.Add(comp);
            tmpWayPointComponents.Add(comp);
        }
        private void RebuildMapComponents()
        {
            if (!mapSink.IsOpened)
            {
                return;
            }

            foreach (WaypointMapComponent comp in wayPointComponents)
            {
                mapSink.RemoveMapData(comp);
                comp.Dispose();
            }

            wayPointComponents.Clear();


            foreach (Waypoint wp in ownWaypoints)
            {
                WaypointMapComponent comp = new WaypointMapComponent(wp, texture, api as ICoreClientAPI);

                wayPointComponents.Add(comp);
                mapSink.AddMapData(comp);
            }
        }