Map: Rename IsInMap -> Contains.
This commit is contained in:
@@ -180,7 +180,7 @@ namespace OpenRA.GameRules
|
||||
if (target.Type == TargetType.Terrain)
|
||||
{
|
||||
var cell = target.CenterPosition.ToCPos();
|
||||
if (!world.Map.IsInMap(cell))
|
||||
if (!world.Map.Contains(cell))
|
||||
return false;
|
||||
|
||||
var cellInfo = world.Map.GetTerrainInfo(cell);
|
||||
|
||||
@@ -136,7 +136,7 @@ namespace OpenRA.Graphics
|
||||
|
||||
var color = t.Trait.RadarSignatureColor(t.Actor);
|
||||
foreach (var cell in t.Trait.RadarSignatureCells(t.Actor))
|
||||
if (world.Map.IsInMap(cell))
|
||||
if (world.Map.Contains(cell))
|
||||
*(c + ((cell.Y - world.Map.Bounds.Top) * bitmapData.Stride >> 2) + cell.X - world.Map.Bounds.Left) = color.ToArgb();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -461,7 +461,7 @@ namespace OpenRA
|
||||
return dataStream.ToArray();
|
||||
}
|
||||
|
||||
public bool IsInMap(CPos xy) { return Bounds.Contains(xy.X, xy.Y); }
|
||||
public bool Contains(CPos xy) { return Bounds.Contains(xy.X, xy.Y); }
|
||||
|
||||
public void Resize(int width, int height) // editor magic.
|
||||
{
|
||||
@@ -638,7 +638,7 @@ namespace OpenRA
|
||||
foreach (var offset in TilesByDistance[i])
|
||||
{
|
||||
var t = offset + center;
|
||||
if (IsInMap(t))
|
||||
if (Contains(t))
|
||||
yield return t;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace OpenRA.Orders
|
||||
|
||||
IEnumerable<Order> OrderInner(World world, CPos xy, MouseInput mi)
|
||||
{
|
||||
if (mi.Button == expectedButton && world.Map.IsInMap(xy))
|
||||
if (mi.Button == expectedButton && world.Map.Contains(xy))
|
||||
{
|
||||
world.CancelInputMode();
|
||||
foreach (var subject in subjects)
|
||||
@@ -66,6 +66,6 @@ namespace OpenRA.Orders
|
||||
public virtual void Tick(World world) { }
|
||||
public IEnumerable<IRenderable> Render(WorldRenderer wr, World world) { yield break; }
|
||||
public void RenderAfterWorld(WorldRenderer wr, World world) { }
|
||||
public string GetCursor(World world, CPos xy, MouseInput mi) { return world.Map.IsInMap(xy) ? cursor : "generic-blocked"; }
|
||||
public string GetCursor(World world, CPos xy, MouseInput mi) { return world.Map.Contains(xy) ? cursor : "generic-blocked"; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace OpenRA.Traits
|
||||
|
||||
public IEnumerable<Actor> GetUnitsAt(CPos a)
|
||||
{
|
||||
if (!map.IsInMap(a))
|
||||
if (!map.Contains(a))
|
||||
yield break;
|
||||
|
||||
for (var i = influence[a]; i != null; i = i.Next)
|
||||
@@ -81,7 +81,7 @@ namespace OpenRA.Traits
|
||||
|
||||
public IEnumerable<Actor> GetUnitsAt(CPos a, SubCell sub)
|
||||
{
|
||||
if (!map.IsInMap(a))
|
||||
if (!map.Contains(a))
|
||||
yield break;
|
||||
|
||||
for (var i = influence[a]; i != null; i = i.Next)
|
||||
|
||||
@@ -130,7 +130,7 @@ namespace OpenRA.Traits
|
||||
|
||||
public bool AllowResourceAt(ResourceType rt, CPos cell)
|
||||
{
|
||||
if (!world.Map.IsInMap(cell))
|
||||
if (!world.Map.Contains(cell))
|
||||
return false;
|
||||
|
||||
if (!rt.Info.AllowedTerrainTypes.Contains(world.Map.GetTerrainInfo(cell).Type))
|
||||
|
||||
@@ -217,7 +217,7 @@ namespace OpenRA.Traits
|
||||
|
||||
public bool IsExplored(CPos cell)
|
||||
{
|
||||
if (!map.IsInMap(cell))
|
||||
if (!map.Contains(cell))
|
||||
return false;
|
||||
|
||||
if (Disabled || !self.World.LobbyInfo.GlobalSettings.Shroud)
|
||||
@@ -233,7 +233,7 @@ namespace OpenRA.Traits
|
||||
|
||||
public bool IsVisible(CPos cell)
|
||||
{
|
||||
if (!map.IsInMap(cell))
|
||||
if (!map.Contains(cell))
|
||||
return false;
|
||||
|
||||
if (Disabled || !self.World.LobbyInfo.GlobalSettings.Fog)
|
||||
|
||||
@@ -93,7 +93,7 @@ namespace OpenRA.Widgets
|
||||
{
|
||||
TooltipType = WorldTooltipType.None;
|
||||
var cell = worldRenderer.Position(worldRenderer.Viewport.ViewToWorldPx(Viewport.LastMousePos)).ToCPos();
|
||||
if (!world.Map.IsInMap(cell))
|
||||
if (!world.Map.Contains(cell))
|
||||
return;
|
||||
|
||||
if (world.ShroudObscures(cell))
|
||||
|
||||
Reference in New Issue
Block a user