chore: Use var everywhere (#2294)
This commit is contained in:
parent
0b34cc4417
commit
ebaf104935
267 changed files with 873 additions and 873 deletions
|
|
@ -147,7 +147,7 @@ public partial class Map
|
|||
throw new InvalidOperationException(CollectionThrowStrings.InvalidOperation_EnumFailedVersion);
|
||||
}
|
||||
|
||||
NetState current = _current;
|
||||
var current = _current;
|
||||
|
||||
while (true)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -236,8 +236,8 @@ public partial class Map
|
|||
throw new InvalidOperationException(CollectionThrowStrings.InvalidOperation_EnumFailedVersion);
|
||||
}
|
||||
|
||||
NetState current = _current;
|
||||
ref Rectangle2D bounds = ref _bounds;
|
||||
var current = _current;
|
||||
ref var bounds = ref _bounds;
|
||||
var currentSectorX = _currentSectorX;
|
||||
var currentSectorY = _currentSectorY;
|
||||
var sectorEndX = _sectorEndX;
|
||||
|
|
|
|||
|
|
@ -256,7 +256,7 @@ public partial class Map
|
|||
}
|
||||
|
||||
Item current = _current;
|
||||
ref Rectangle2D bounds = ref _bounds;
|
||||
ref var bounds = ref _bounds;
|
||||
var currentSectorX = _currentSectorX;
|
||||
var currentSectorY = _currentSectorY;
|
||||
var sectorEndX = _sectorEndX;
|
||||
|
|
|
|||
|
|
@ -255,7 +255,7 @@ public partial class Map
|
|||
}
|
||||
|
||||
Mobile current = _current;
|
||||
ref Rectangle2D bounds = ref _bounds;
|
||||
ref var bounds = ref _bounds;
|
||||
var currentSectorX = _currentSectorX;
|
||||
var currentSectorY = _currentSectorY;
|
||||
var sectorEndX = _sectorEndX;
|
||||
|
|
|
|||
|
|
@ -236,7 +236,7 @@ public partial class Map
|
|||
return false;
|
||||
}
|
||||
|
||||
ref Rectangle2D bounds = ref _bounds;
|
||||
ref var bounds = ref _bounds;
|
||||
var currentSectorX = _currentSectorX;
|
||||
var currentSectorY = _currentSectorY;
|
||||
var sectorEndX = _sectorEndX;
|
||||
|
|
|
|||
|
|
@ -92,8 +92,8 @@ public partial class Map
|
|||
var components = multi!.Components;
|
||||
var location = multi!.Location;
|
||||
|
||||
int offsetX = p.X - location.X - components.Min.X;
|
||||
int offsetY = p.Y - location.Y - components.Min.Y;
|
||||
var offsetX = p.X - location.X - components.Min.X;
|
||||
var offsetY = p.Y - location.Y - components.Min.Y;
|
||||
|
||||
if (offsetX >= 0 && offsetY >= 0 && offsetX < components.Width && offsetY < components.Height)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -494,10 +494,10 @@ public sealed partial class Map : IComparable<Map>, ISpanFormattable, ISpanParsa
|
|||
out int sectorStartX, out int sectorStartY,
|
||||
out int sectorEndX, out int sectorEndY)
|
||||
{
|
||||
int left = bounds.Start.X;
|
||||
int top = bounds.Start.Y;
|
||||
int right = bounds.End.X;
|
||||
int bottom = bounds.End.Y;
|
||||
var left = bounds.Start.X;
|
||||
var top = bounds.Start.Y;
|
||||
var right = bounds.End.X;
|
||||
var bottom = bounds.End.Y;
|
||||
|
||||
// Limit the coordinates to inside the valid map region
|
||||
Bound(left, top, out left, out top);
|
||||
|
|
@ -1070,7 +1070,7 @@ public sealed partial class Map : IComparable<Map>, ISpanFormattable, ISpanParsa
|
|||
contains = ltID == InvalidLandTiles[j];
|
||||
}
|
||||
|
||||
bool foundStatic = false;
|
||||
var foundStatic = false;
|
||||
|
||||
foreach (var t in Tiles.GetStaticAndMultiTiles(point.X, point.Y))
|
||||
{
|
||||
|
|
@ -1094,7 +1094,7 @@ public sealed partial class Map : IComparable<Map>, ISpanFormattable, ISpanParsa
|
|||
|
||||
if (contains && !foundStatic)
|
||||
{
|
||||
foreach (Item item in GetItemsAt(point))
|
||||
foreach (var item in GetItemsAt(point))
|
||||
{
|
||||
if (item.Visible)
|
||||
{
|
||||
|
|
@ -1289,7 +1289,7 @@ public sealed partial class Map : IComparable<Map>, ISpanFormattable, ISpanParsa
|
|||
return Internal;
|
||||
}
|
||||
|
||||
for (int i = 0; i < Maps.Length; i++)
|
||||
for (var i = 0; i < Maps.Length; i++)
|
||||
{
|
||||
var map = Maps[i];
|
||||
if (map == null)
|
||||
|
|
@ -1332,7 +1332,7 @@ public sealed partial class Map : IComparable<Map>, ISpanFormattable, ISpanParsa
|
|||
return true;
|
||||
}
|
||||
|
||||
for (int i = 0; i < Maps.Length; i++)
|
||||
for (var i = 0; i < Maps.Length; i++)
|
||||
{
|
||||
var map = Maps[i];
|
||||
if (map == null)
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ public static class MapSelection
|
|||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool MoveNext()
|
||||
{
|
||||
MapSelectionFlags[] localList = _allMaps;
|
||||
var localList = _allMaps;
|
||||
|
||||
while ((uint)_index < (uint)localList.Length)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue