diff --git a/OpenRA.Mods.Common/Traits/World/DomainIndex.cs b/OpenRA.Mods.Common/Traits/World/DomainIndex.cs index edac9623b2..301b4be5c6 100644 --- a/OpenRA.Mods.Common/Traits/World/DomainIndex.cs +++ b/OpenRA.Mods.Common/Traits/World/DomainIndex.cs @@ -70,15 +70,15 @@ namespace OpenRA.Mods.Common.Traits { readonly Map map; readonly uint movementClass; - readonly CellLayer domains; - readonly Dictionary> transientConnections; + readonly CellLayer domains; + readonly Dictionary> transientConnections; public MovementClassDomainIndex(World world, uint movementClass) { map = world.Map; this.movementClass = movementClass; - domains = new CellLayer(world.Map); - transientConnections = new Dictionary>(); + domains = new CellLayer(world.Map); + transientConnections = new Dictionary>(); using (new PerfTimer("BuildDomains: {0} for movement class {1}".F(world.Map.Title, movementClass))) BuildDomains(world); @@ -99,7 +99,7 @@ namespace OpenRA.Mods.Common.Traits public void UpdateCells(World world, HashSet dirtyCells) { - var neighborDomains = new List(); + var neighborDomains = new List(); foreach (var cell in dirtyCells) { @@ -147,11 +147,11 @@ namespace OpenRA.Mods.Common.Traits CreateConnection(c1, c2); } - bool HasConnection(int d1, int d2) + bool HasConnection(ushort d1, ushort d2) { // Search our connections graph for a possible route - var visited = new HashSet(); - var toProcess = new Stack(); + var visited = new HashSet(); + var toProcess = new Stack(); toProcess.Push(d1); while (toProcess.Any()) @@ -175,12 +175,12 @@ namespace OpenRA.Mods.Common.Traits return false; } - void CreateConnection(int d1, int d2) + void CreateConnection(ushort d1, ushort d2) { if (!transientConnections.ContainsKey(d1)) - transientConnections[d1] = new HashSet(); + transientConnections[d1] = new HashSet(); if (!transientConnections.ContainsKey(d2)) - transientConnections[d2] = new HashSet(); + transientConnections[d2] = new HashSet(); transientConnections[d1].Add(d2); transientConnections[d2].Add(d1); @@ -197,7 +197,7 @@ namespace OpenRA.Mods.Common.Traits void BuildDomains(World world) { - var domain = 1; + ushort domain = 1; var visited = new CellLayer(map);