Introduce WPos versions of FogObscures and ShroudObscures.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user