Exemple #1
0
        /// <summary>
        /// Gets the most optimal path of grid positions for the drone based on the target positionX and positionX.
        /// Automatically sets the drones path and target locations
        /// </summary>
        /// <param name="drone"></param>
        /// <param name="targetX"></param>
        /// <param name="targetY"></param>
        /// <returns>path list</returns>
        public IGridPosition[] GetPathForDrone(IDrone drone, int targetX, int targetY)
        {
            var path = Map.GetPath(drone.CurrentX, drone.CurrentY, targetX, targetY);

            drone.SetTargetPosition(targetX, targetY);
            drone.SetPath(path);

            return(path);
        }