moving Actor.Location onto the appropriate traits (bob)

This commit is contained in:
Chris Forbes
2010-06-19 14:37:06 +12:00
parent db465e1fdd
commit 66adbee2a6
25 changed files with 218 additions and 103 deletions

View File

@@ -110,19 +110,19 @@ namespace OpenRA.Mods.RA
foreach (var w in adjWalls)
{
w.traits.Get<RenderBuildingWall>().AddAdjacentWall(w, self);
AddAdjacentWall(self, w);
w.traits.Get<RenderBuildingWall>().AddAdjacentWall(w.Location, self.Location);
AddAdjacentWall(self.Location, w.Location);
}
hasTicked = true;
}
}
void AddAdjacentWall(Actor self, Actor other)
void AddAdjacentWall(int2 location, int2 otherLocation)
{
if (other.Location == self.Location + new int2(0, -1)) adjacentWalls |= 1;
if (other.Location == self.Location + new int2(+1, 0)) adjacentWalls |= 2;
if (other.Location == self.Location + new int2(0, +1)) adjacentWalls |= 4;
if (other.Location == self.Location + new int2(-1, 0)) adjacentWalls |= 8;
if (otherLocation == location + new int2(0, -1)) adjacentWalls |= 1;
if (otherLocation == location + new int2(+1, 0)) adjacentWalls |= 2;
if (otherLocation == location + new int2(0, +1)) adjacentWalls |= 4;
if (otherLocation == location + new int2(-1, 0)) adjacentWalls |= 8;
}
}
}