public int AddWaypoint(AGT_Waypoint waypoint) { lock (this) { _waypoints.AddLast(waypoint); return(_waypoints.Count); } }
public int AddWaypoint(AGT_Waypoint waypoint) { lock (this) { _waypoints.AddLast(waypoint); return _waypoints.Count; } }
public bool DeleteWaypoint(AGT_Waypoint waypoint) { lock (this) { LinkedListNode <AGT_Waypoint> node = _waypoints.Find(waypoint); if (node != null) { _waypoints.Remove(node); return(true); } return(false); } }
public bool InsertWaypoint(AGT_Waypoint after, AGT_Waypoint insert) { lock (this) { LinkedListNode <AGT_Waypoint> node = _waypoints.Find(after); if (node != null) { _waypoints.AddAfter(_waypoints.Find(after), insert); return(true); } return(false); } }
public bool DeleteWaypoint(AGT_Waypoint waypoint) { lock (this) { LinkedListNode<AGT_Waypoint> node = _waypoints.Find(waypoint); if (node != null) { _waypoints.Remove(node); return true; } return false; } }
public AGT_Waypoint InsertWaypointAt(int x, int y) { lock (this) { LinkedListNode <AGT_Waypoint> node = _waypoints.First; while (node.Next != null) { if (LineHitTest(node.Value.X, node.Value.Y, node.Next.Value.X, node.Next.Value.Y, x, y)) { if (((node.Value.X <= x) && (node.Next.Value.X >= x)) && ((node.Value.Y <= y) && (node.Next.Value.Y >= y))) { float new_x = (node.Next.Value.X + node.Value.X) * .5f; float new_y = (node.Next.Value.Y + node.Value.Y) * .5f; AGT_Waypoint point = new AGT_Waypoint("Point " + _waypoints.Count, (float)new_x, (float)new_y, 0); _waypoints.AddAfter(node, point); return(point); } } node = node.Next; } return(null); } }
public AGT_Waypoint InsertWaypointAt(int x, int y) { lock (this) { LinkedListNode<AGT_Waypoint> node = _waypoints.First; while (node.Next != null) { if (LineHitTest(node.Value.X, node.Value.Y, node.Next.Value.X, node.Next.Value.Y, x, y)) { if ( ((node.Value.X <= x) && (node.Next.Value.X >= x)) && ((node.Value.Y <= y) && (node.Next.Value.Y >= y)) ) { float new_x = (node.Next.Value.X + node.Value.X) * .5f; float new_y = (node.Next.Value.Y + node.Value.Y) * .5f; AGT_Waypoint point = new AGT_Waypoint("Point " + _waypoints.Count, (float)new_x, (float)new_y, 0); _waypoints.AddAfter(node, point); return point; } } node = node.Next; } return null; } }
public bool InsertWaypoint(AGT_Waypoint after, AGT_Waypoint insert) { lock (this) { LinkedListNode<AGT_Waypoint> node = _waypoints.Find(after); if (node != null) { _waypoints.AddAfter(_waypoints.Find(after), insert); return true; } return false; } }