Fix RCS1227
This commit is contained in:
@@ -1109,6 +1109,9 @@ dotnet_diagnostic.RCS1225.severity = warning
|
|||||||
# Add paragraph to documentation comment.
|
# Add paragraph to documentation comment.
|
||||||
dotnet_diagnostic.RCS1226.severity = warning
|
dotnet_diagnostic.RCS1226.severity = warning
|
||||||
|
|
||||||
|
# Validate arguments correctly.
|
||||||
|
dotnet_diagnostic.RCS1227.severity = warning
|
||||||
|
|
||||||
# Unnecessary explicit use of enumerator.
|
# Unnecessary explicit use of enumerator.
|
||||||
dotnet_diagnostic.RCS1230.severity = warning
|
dotnet_diagnostic.RCS1230.severity = warning
|
||||||
|
|
||||||
|
|||||||
@@ -1353,13 +1353,18 @@ namespace OpenRA
|
|||||||
throw new ArgumentOutOfRangeException(nameof(maxRange),
|
throw new ArgumentOutOfRangeException(nameof(maxRange),
|
||||||
$"The requested range ({maxRange}) cannot exceed the value of MaximumTileSearchRange ({Grid.MaximumTileSearchRange})");
|
$"The requested range ({maxRange}) cannot exceed the value of MaximumTileSearchRange ({Grid.MaximumTileSearchRange})");
|
||||||
|
|
||||||
for (var i = minRange; i <= maxRange; i++)
|
return FindTilesInAnnulus();
|
||||||
|
|
||||||
|
IEnumerable<CPos> FindTilesInAnnulus()
|
||||||
{
|
{
|
||||||
foreach (var offset in Grid.TilesByDistance[i])
|
for (var i = minRange; i <= maxRange; i++)
|
||||||
{
|
{
|
||||||
var t = offset + center;
|
foreach (var offset in Grid.TilesByDistance[i])
|
||||||
if (allowOutsideBounds ? Tiles.Contains(t) : Contains(t))
|
{
|
||||||
yield return t;
|
var t = offset + center;
|
||||||
|
if (allowOutsideBounds ? Tiles.Contains(t) : Contains(t))
|
||||||
|
yield return t;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user