wire up hide-map crate properly

This commit is contained in:
Chris Forbes
2010-03-30 18:40:37 +13:00
parent a71ba665a7
commit c159300ecf
3 changed files with 11 additions and 5 deletions

View File

@@ -26,12 +26,12 @@ using System.Drawing;
namespace OpenRA.Traits
{
class ShroudInfo : ITraitInfo
public class ShroudInfo : ITraitInfo
{
public object Create(Actor self) { return new Shroud(self, this); }
}
class Shroud
public class Shroud
{
Map map;
@@ -124,5 +124,12 @@ namespace OpenRA.Traits
exploredBounds = exploredBounds.HasValue ?
Rectangle.Union(exploredBounds.Value, box) : box;
}
public void ResetExploration() // for `hide map` crate
{
for (var j = 0; j <= exploredCells.GetUpperBound(1); j++)
for (var i = 0; i <= exploredCells.GetUpperBound(0); i++)
exploredCells[i, j] = visibleCells[i, j] > 0;
}
}
}