Introduce WPos versions of FogObscures and ShroudObscures.

This commit is contained in:
Paul Chote
2015-06-07 19:24:23 +01:00
parent 07aa575c6b
commit 66dd3c553c
2 changed files with 12 additions and 0 deletions

View File

@@ -292,6 +292,11 @@ namespace OpenRA.Traits
Invalidate(changed);
}
public bool IsExplored(WPos pos)
{
return IsExplored(map.CellContaining(pos));
}
public bool IsExplored(CPos cell)
{
return IsExplored(cell.ToMPos(map));
@@ -334,6 +339,11 @@ namespace OpenRA.Traits
return GetVisOrigins(a).Any(IsExplored);
}
public bool IsVisible(WPos pos)
{
return IsVisible(map.CellContaining(pos));
}
public bool IsVisible(CPos cell)
{
var uv = cell.ToMPos(map);

View File

@@ -72,8 +72,10 @@ namespace OpenRA
public bool FogObscures(Actor a) { return RenderPlayer != null && !RenderPlayer.Shroud.IsVisible(a); }
public bool FogObscures(CPos p) { return RenderPlayer != null && !RenderPlayer.Shroud.IsVisible(p); }
public bool FogObscures(WPos pos) { return RenderPlayer != null && !RenderPlayer.Shroud.IsVisible(pos); }
public bool ShroudObscures(Actor a) { return RenderPlayer != null && !RenderPlayer.Shroud.IsExplored(a); }
public bool ShroudObscures(CPos p) { return RenderPlayer != null && !RenderPlayer.Shroud.IsExplored(p); }
public bool ShroudObscures(WPos pos) { return RenderPlayer != null && !RenderPlayer.Shroud.IsExplored(pos); }
public bool ShroudObscures(MPos uv) { return RenderPlayer != null && !RenderPlayer.Shroud.IsExplored(uv); }
public Func<MPos, bool> FogObscuresTest(CellRegion region)