chore: Use var everywhere (#2294)

This commit is contained in:
Kamron Batman 2025-12-27 16:47:28 -08:00 • committed by GitHub
parent 0b34cc4417
commit ebaf104935
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
267 changed files with 873 additions and 873 deletions

View file

@ -147,7 +147,7 @@ public partial class Map
throw new InvalidOperationException(CollectionThrowStrings.InvalidOperation_EnumFailedVersion);
}
NetState current = _current;
var current = _current;
while (true)
{

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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)
{

View file

@ -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)

View file

@ -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)
{