Exemple #1
0
    void disconnectPoints()
    {
        List <Waypoint> list = WaypointSaver.loadWaypoints();

        if (points.x > -1 && points.x < list.Count && points.y > -1 && points.y < list.Count)
        {
            foreach (Waypoint p in list)
            {
                if (p.getNumber() == points.x)
                {
                    if (p.getConnections().Contains(points.y))
                    {
                        p.getConnections().Remove(points.y);
                    }
                }
                else if (p.getNumber() == points.y)
                {
                    if (p.getConnections().Contains(points.x))
                    {
                        p.getConnections().Remove(points.x);
                    }
                }
            }
            WaypointSaver.saveWaypoints(list);
        }
    }
Exemple #2
0
    void saveNewWaypoint()
    {
        Waypoint wp = new Waypoint();

        wp.setId(Guid.NewGuid().ToString());
        wp.setLocation(WaypointDebug.getCurrentLocation());

        lastPointId = wp.getId();

        List <Waypoint> list = WaypointSaver.loadWaypoints();

        wp.setNumber(list.Count);
        list.Add(wp);
        WaypointSaver.saveWaypoints(list);
    }