added Shroud.Explore overload in prep for spyplane

This commit is contained in:
Chris Forbes
2010-01-23 13:19:28 +13:00
parent 0d7a1ef251
commit f1e0b46d38

View File

@@ -79,11 +79,9 @@ namespace OpenRa
return IsExplored(x,y); return IsExplored(x,y);
} }
public void Explore(Actor a) public void Explore(World w, int2 center, int range)
{ {
foreach (var t in a.World.FindTilesInCircle( foreach (var t in w.FindTilesInCircle(center, range))
(1f / Game.CellSize * a.CenterLocation).ToInt2(),
a.Info.Traits.Get<OwnedActorInfo>().Sight))
{ {
explored[t.X, t.Y] = true; explored[t.X, t.Y] = true;
gapField[t.X, t.Y] = 0; gapField[t.X, t.Y] = 0;
@@ -91,6 +89,13 @@ namespace OpenRa
dirty = true; dirty = true;
} }
public void Explore(Actor a)
{
Explore(a.World,
(1f / Game.CellSize * a.CenterLocation).ToInt2(),
a.Info.Traits.Get<OwnedActorInfo>().Sight);
}
static readonly byte[][] SpecialShroudTiles = static readonly byte[][] SpecialShroudTiles =
{ {
new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },