1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
use crateGetRangeTo;
/// Helper function to create a goal function closure for exact node matching with a single goal node.
///
/// If using the convenience functions for common pathfinding use-cases,
/// you will not normally need to use this function.
///
/// # Examples
/// ```rust
/// use screeps::RoomXY;
/// use screeps_pathfinding::utils::goals::goal_exact_node;
/// use screeps_pathfinding::utils::heuristics::heuristic_get_range_to;
///
/// let start = RoomXY::checked_new(24, 18).unwrap();
/// let goal = RoomXY::checked_new(34, 40).unwrap();
/// let cost_fn = |_| Some(1);
/// screeps_pathfinding::algorithms::astar::shortest_path_roomxy(
/// start,
/// &goal_exact_node(goal),
/// cost_fn,
/// &heuristic_get_range_to(goal),
/// );
/// Helper function to create a goal function closure for exact node matching with multiple goal nodes.
///
/// If using the convenience functions for common pathfinding use-cases,
/// you will not normally need to use this function.
///
/// # Examples
/// ```rust
/// use screeps::RoomXY;
/// use screeps_pathfinding::utils::goals::goal_exact_node_multigoal;
/// use screeps_pathfinding::utils::heuristics::heuristic_get_range_to_multigoal;
///
/// let start = RoomXY::checked_new(24, 18).unwrap();
/// let goal_a = RoomXY::checked_new(34, 40).unwrap();
/// let goal_b = RoomXY::checked_new(34, 45).unwrap();
/// let goals = &[goal_a, goal_b];
/// let cost_fn = |_| Some(1);
/// screeps_pathfinding::algorithms::astar::shortest_path_roomxy(
/// start,
/// &goal_exact_node_multigoal(goals),
/// cost_fn,
/// &heuristic_get_range_to_multigoal(goals),
/// );
+ '_
/// Helper function to create a goal function closure for matching
/// nodes <= than the specified range from a single goal node.
///
/// If using the convenience functions for common pathfinding use-cases,
/// you will not normally need to use this function.
///
/// # Examples
/// ```rust
/// use screeps::RoomXY;
/// use screeps_pathfinding::utils::goals::goal_range_to_node;
/// use screeps_pathfinding::utils::heuristics::heuristic_get_range_to;
///
/// let start = RoomXY::checked_new(24, 18).unwrap();
/// let goal = RoomXY::checked_new(34, 40).unwrap();
/// let cost_fn = |_| Some(1);
/// screeps_pathfinding::algorithms::astar::shortest_path_roomxy(
/// start,
/// &goal_range_to_node(goal, 3),
/// cost_fn,
/// &heuristic_get_range_to(goal),
/// );
/// Helper function to create a goal function closure for matching
/// nodes <= than the specified range from any of multiple goal nodes.
///
/// If using the convenience functions for common pathfinding use-cases,
/// you will not normally need to use this function.
///
/// # Examples
/// ```rust
/// use screeps::RoomXY;
/// use screeps_pathfinding::utils::goals::goal_range_to_node_multigoal;
/// use screeps_pathfinding::utils::heuristics::heuristic_get_range_to_multigoal;
///
/// let start = RoomXY::checked_new(24, 18).unwrap();
/// let goal_a = RoomXY::checked_new(34, 40).unwrap();
/// let goal_b = RoomXY::checked_new(34, 45).unwrap();
/// let goals = &[goal_a, goal_b];
/// let cost_fn = |_| Some(1);
/// screeps_pathfinding::algorithms::astar::shortest_path_roomxy(
/// start,
/// &goal_range_to_node_multigoal(goals, 3),
/// cost_fn,
/// &heuristic_get_range_to_multigoal(goals),
/// );
+ '_