Changed removeActorPosition field in ActorMap into a set.

This is because it's purpose is to be queried via Contains when actors needed to be removed.
This commit is contained in:
RoosterDragon
2014-05-21 20:19:39 +01:00
parent db08357e36
commit 2bd8778c55

View File

@@ -49,8 +49,8 @@ namespace OpenRA.Traits
// Position updates are done in one pass
// to ensure consistency during a tick
List<Actor> addActorPosition;
List<Actor> removeActorPosition;
readonly List<Actor> addActorPosition = new List<Actor>();
readonly HashSet<Actor> removeActorPosition = new HashSet<Actor>();
public ActorMap(World world, ActorMapInfo info)
{
@@ -64,9 +64,6 @@ namespace OpenRA.Traits
for (var j = 0; j < rows; j++)
for (var i = 0; i < cols; i++)
actors[j * cols + i] = new List<Actor>();
addActorPosition = new List<Actor>();
removeActorPosition = new List<Actor>();
}
public IEnumerable<Actor> GetUnitsAt(CPos a)