/// <summary> /// Starts the MovementAI /// </summary> /// <returns>Whether already arrived</returns> public bool MoveToPoints(List<Vector3> points) { if (!m_owner.IsInWorld) { // something's wrong here m_owner.DeleteNow(); return false; } m_destination = points[points.Count - 1]; if (IsAtDestination) { return true; } // TODO: Consider flying units & liquid levels var pos = m_owner.Position; pos.Z += 5; m_currentQuery = new PathQuery(pos, ref m_destination, m_owner.ContextHandler, OnPathQueryReply); m_currentQuery.Path.Reset(points.Count); foreach (var point in points) { m_currentQuery.Path.Add(point); } m_currentQuery.Reply(); //m_owner.Map.Terrain.FindPath(m_currentQuery); // cannot move return false; }
public void FindPath(PathQuery query) { query.Path.Reset(1); query.Path.Add(query.To); query.Reply(); }
public void QueryDirectPath(PathQuery query) { var wayPoints = WorldMap.GetDirectPath(id, query.From, query.To); query.Reply(new Path(wayPoints)); }
public void QueryDirectPath(PathQuery query) { query.Reply(new Path(query.To)); }
public void FindPath(PathQuery query) { FindPath(query.From, query.To, query.Path); query.Reply(); }