Replace DomainIndex internals with a lookup from HierarchicalPathFinder instead
Teach HierarchicalPathFinder to keep a cache of domain indices, refreshing them only on demand and when invalidated by terrain changes. This provides an accurate and quick determination for checking if paths exist between given locations. By exposing PathExistsForLocomotor on the IPathFinder interface, we can remove the DomainIndex trait entirely.
This commit is contained in:
committed by
Matthias Mailänder
parent
5a8f91aa21
commit
aef65d353d
@@ -815,5 +815,12 @@ namespace OpenRA.Mods.Common.Traits
|
||||
Func<CPos, int> customCost = null,
|
||||
Actor ignoreActor = null,
|
||||
bool laneBias = true);
|
||||
|
||||
/// <summary>
|
||||
/// Determines if a path exists between source and target.
|
||||
/// Only terrain is taken into account, i.e. as if <see cref="BlockedByActor.None"/> was given.
|
||||
/// This would apply for any actor using the given <see cref="Locomotor"/>.
|
||||
/// </summary>
|
||||
bool PathExistsForLocomotor(Locomotor locomotor, CPos source, CPos target);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user