Remove plumbing for trait unit tests.
This commit is contained in:
committed by
Paul Chote
parent
8d0acaaa4f
commit
044b51742f
@@ -29,7 +29,7 @@ namespace OpenRA.Mods.Common.Pathfinder
|
||||
/// <summary>
|
||||
/// Creates (or obtains from the pool) a CellLayer given a map
|
||||
/// </summary>
|
||||
CellLayer<CellInfo> NewLayer(IMap map);
|
||||
CellLayer<CellInfo> NewLayer(Map map);
|
||||
}
|
||||
|
||||
public sealed class CellInfoLayerManager : ICellInfoLayerManager
|
||||
@@ -65,7 +65,7 @@ namespace OpenRA.Mods.Common.Pathfinder
|
||||
cellInfoPool.Enqueue(ci);
|
||||
}
|
||||
|
||||
public CellLayer<CellInfo> NewLayer(IMap map)
|
||||
public CellLayer<CellInfo> NewLayer(Map map)
|
||||
{
|
||||
CellLayer<CellInfo> result = null;
|
||||
var mapSize = new Size(map.MapSize.X, map.MapSize.Y);
|
||||
|
||||
@@ -22,10 +22,10 @@ namespace OpenRA.Mods.Common.Pathfinder
|
||||
}
|
||||
|
||||
const int MaxPathAge = 50;
|
||||
readonly IWorld world;
|
||||
readonly World world;
|
||||
Dictionary<string, CachedPath> cachedPaths = new Dictionary<string, CachedPath>(100);
|
||||
|
||||
public PathCacheStorage(IWorld world)
|
||||
public PathCacheStorage(World world)
|
||||
{
|
||||
this.world = world;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace OpenRA.Mods.Common.Pathfinder
|
||||
this.cacheStorage = cacheStorage;
|
||||
}
|
||||
|
||||
public List<CPos> FindUnitPath(CPos source, CPos target, IActor self)
|
||||
public List<CPos> FindUnitPath(CPos source, CPos target, Actor self)
|
||||
{
|
||||
using (new PerfSample("Pathfinder"))
|
||||
{
|
||||
@@ -47,7 +47,7 @@ namespace OpenRA.Mods.Common.Pathfinder
|
||||
}
|
||||
}
|
||||
|
||||
public List<CPos> FindUnitPathToRange(CPos source, SubCell srcSub, WPos target, WRange range, IActor self)
|
||||
public List<CPos> FindUnitPathToRange(CPos source, SubCell srcSub, WPos target, WRange range, Actor self)
|
||||
{
|
||||
using (new PerfSample("Pathfinder"))
|
||||
{
|
||||
|
||||
@@ -38,11 +38,11 @@ namespace OpenRA.Mods.Common.Pathfinder
|
||||
|
||||
bool InReverse { get; set; }
|
||||
|
||||
IActor IgnoredActor { get; set; }
|
||||
Actor IgnoredActor { get; set; }
|
||||
|
||||
IWorld World { get; }
|
||||
World World { get; }
|
||||
|
||||
IActor Actor { get; }
|
||||
Actor Actor { get; }
|
||||
}
|
||||
|
||||
public struct GraphConnection
|
||||
@@ -61,21 +61,21 @@ namespace OpenRA.Mods.Common.Pathfinder
|
||||
|
||||
public class PathGraph : IGraph<CellInfo>
|
||||
{
|
||||
public IActor Actor { get; private set; }
|
||||
public IWorld World { get; private set; }
|
||||
public Actor Actor { get; private set; }
|
||||
public World World { get; private set; }
|
||||
public Func<CPos, bool> CustomBlock { get; set; }
|
||||
public Func<CPos, int> CustomCost { get; set; }
|
||||
public int LaneBias { get; set; }
|
||||
public bool InReverse { get; set; }
|
||||
public IActor IgnoredActor { get; set; }
|
||||
public Actor IgnoredActor { get; set; }
|
||||
|
||||
readonly CellConditions checkConditions;
|
||||
readonly IMobileInfo mobileInfo;
|
||||
readonly MobileInfo mobileInfo;
|
||||
CellLayer<CellInfo> cellInfo;
|
||||
|
||||
public const int InvalidNode = int.MaxValue;
|
||||
|
||||
public PathGraph(CellLayer<CellInfo> cellInfo, IMobileInfo mobileInfo, IActor actor, IWorld world, bool checkForBlocked)
|
||||
public PathGraph(CellLayer<CellInfo> cellInfo, MobileInfo mobileInfo, Actor actor, World world, bool checkForBlocked)
|
||||
{
|
||||
this.cellInfo = cellInfo;
|
||||
World = world;
|
||||
|
||||
@@ -32,13 +32,13 @@ namespace OpenRA.Mods.Common.Pathfinder
|
||||
considered = new LinkedList<Pair<CPos, int>>();
|
||||
}
|
||||
|
||||
public static IPathSearch Search(IWorld world, IMobileInfo mi, IActor self, bool checkForBlocked)
|
||||
public static IPathSearch Search(World world, MobileInfo mi, Actor self, bool checkForBlocked)
|
||||
{
|
||||
var graph = new PathGraph(CellInfoLayerManager.Instance.NewLayer(world.Map), mi, self, world, checkForBlocked);
|
||||
return new PathSearch(graph);
|
||||
}
|
||||
|
||||
public static IPathSearch FromPoint(IWorld world, IMobileInfo mi, IActor self, CPos from, CPos target, bool checkForBlocked)
|
||||
public static IPathSearch FromPoint(World world, MobileInfo mi, Actor self, CPos from, CPos target, bool checkForBlocked)
|
||||
{
|
||||
var graph = new PathGraph(CellInfoLayerManager.Instance.NewLayer(world.Map), mi, self, world, checkForBlocked);
|
||||
var search = new PathSearch(graph)
|
||||
@@ -52,7 +52,7 @@ namespace OpenRA.Mods.Common.Pathfinder
|
||||
return search;
|
||||
}
|
||||
|
||||
public static IPathSearch FromPoints(IWorld world, IMobileInfo mi, IActor self, IEnumerable<CPos> froms, CPos target, bool checkForBlocked)
|
||||
public static IPathSearch FromPoints(World world, MobileInfo mi, Actor self, IEnumerable<CPos> froms, CPos target, bool checkForBlocked)
|
||||
{
|
||||
var graph = new PathGraph(CellInfoLayerManager.Instance.NewLayer(world.Map), mi, self, world, checkForBlocked);
|
||||
var search = new PathSearch(graph)
|
||||
|
||||
Reference in New Issue
Block a user