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

@ -8,8 +8,8 @@ namespace Server.Tests.Network
[Fact]
public void TestSwing()
{
Serial attacker = (Serial)0x1024;
Serial defender = (Serial)0x2048;
var attacker = (Serial)0x1024;
var defender = (Serial)0x2048;
var expected = new Swing(attacker, defender).Compile();
@ -35,7 +35,7 @@ namespace Server.Tests.Network
[Fact]
public void TestChangeCombatant()
{
Serial serial = (Serial)0x1024;
var serial = (Serial)0x1024;
var expected = new ChangeCombatant(serial).Compile();

View file

@ -11,7 +11,7 @@ namespace Server.Tests.Network
[Fact]
public void TestContainerDisplay()
{
Serial serial = (Serial)0x1024;
var serial = (Serial)0x1024;
ushort gumpId = 100;
var expected = new ContainerDisplay(serial, gumpId).Compile();
@ -26,7 +26,7 @@ namespace Server.Tests.Network
[Fact]
public void TestContainerDisplayHS()
{
Serial serial = (Serial)0x1024;
var serial = (Serial)0x1024;
ushort gumpId = 100;
var expected = new ContainerDisplayHS(serial, gumpId).Compile();
@ -42,7 +42,7 @@ namespace Server.Tests.Network
[Fact]
public void TestDisplaySpellbook()
{
Serial serial = (Serial)0x1024;
var serial = (Serial)0x1024;
var expected = new DisplaySpellbook(serial).Compile();
@ -56,7 +56,7 @@ namespace Server.Tests.Network
[Fact]
public void TestDisplaySpellbookHS()
{
Serial serial = (Serial)0x1024;
var serial = (Serial)0x1024;
var expected = new DisplaySpellbookHS(serial).Compile();
@ -71,11 +71,11 @@ namespace Server.Tests.Network
[Fact]
public void TestNewSpellbookContent()
{
Serial serial = (Serial)0x1024;
var serial = (Serial)0x1024;
ushort graphic = 100;
ushort offset = 10;
ulong content = 0x123456789ABCDEF0;
bool opl = ObjectPropertyList.Enabled;
var opl = ObjectPropertyList.Enabled;
var expected = new NewSpellbookContent(serial, graphic, offset, content).Compile();
@ -92,7 +92,7 @@ namespace Server.Tests.Network
[Fact]
public void TestSpellbookContent()
{
Serial serial = (Serial)0x1024;
var serial = (Serial)0x1024;
ushort offset = 10;
ushort graphic = 100;
ulong content = 0x123456789ABCDEF0;
@ -109,7 +109,7 @@ namespace Server.Tests.Network
[Fact]
public void TestSpellbookContent6017()
{
Serial serial = (Serial)0x1024;
var serial = (Serial)0x1024;
ushort offset = 10;
ushort graphic = 100;
ulong content = 0x123456789ABCDEF0;
@ -127,7 +127,7 @@ namespace Server.Tests.Network
[Fact]
public void TestContainerContentUpdate()
{
Serial serial = (Serial)0x1024;
var serial = (Serial)0x1024;
var item = new Item(serial);
var expected = new ContainerContentUpdate(item).Compile();
@ -142,7 +142,7 @@ namespace Server.Tests.Network
[Fact]
public void TestContainerContentUpdate6017()
{
Serial serial = (Serial)0x1024;
var serial = (Serial)0x1024;
var item = new Item(serial);
var expected = new ContainerContentUpdate6017(item).Compile();

View file

@ -9,7 +9,7 @@ public class DamagePacketTests
[Theory, InlineData(10), InlineData(-5), InlineData(1024)]
public void TestDamagePacketOld(int inputAmount)
{
Serial serial = (Serial)0x1024;
var serial = (Serial)0x1024;
var expected = new DamagePacketOld(serial, inputAmount).Compile();
@ -23,7 +23,7 @@ public class DamagePacketTests
[Theory, InlineData(10), InlineData(-5), InlineData(1024), InlineData(100000)]
public void TestDamage(int inputAmount)
{
Serial serial = (Serial)0x1024;
var serial = (Serial)0x1024;
var expected = new DamagePacket(serial, inputAmount).Compile();

View file

@ -24,9 +24,9 @@ namespace Server.Tests.Network
public void TestParticleEffect()
{
var effectType = EffectType.Moving;
Serial serial = (Serial)0x4000;
Serial from = (Serial)0x1000;
Serial to = (Serial)0x2000;
var serial = (Serial)0x4000;
var from = (Serial)0x1000;
var to = (Serial)0x2000;
var itemId = 0x100;
var fromPoint = new Point3D(1000, 100, -10);
var toPoint = new Point3D(1500, 500, 0);
@ -63,8 +63,8 @@ namespace Server.Tests.Network
public void TestHuedEffect()
{
var effectType = EffectType.Moving;
Serial from = (Serial)0x1000;
Serial to = (Serial)0x2000;
var from = (Serial)0x1000;
var to = (Serial)0x2000;
var itemId = 0x100;
var fromPoint = new Point3D(1000, 100, -10);
var toPoint = new Point3D(1500, 500, 0);

View file

@ -22,7 +22,7 @@ public class GumpPacketTests
[Fact]
public void TestDisplaySignGump()
{
Serial gumpSerial = (Serial)0x1000;
var gumpSerial = (Serial)0x1000;
const int gumpId = 100;
const string unknownString = "This is an unknown string";
const string caption = "This is a caption";

View file

@ -9,7 +9,7 @@ public class ItemPacketTests
[Fact]
public void TestWorldItemPacket()
{
Serial serial = (Serial)0x1024;
var serial = (Serial)0x1024;
var itemId = 1;
// Move to fixture
@ -45,7 +45,7 @@ public class ItemPacketTests
[Fact]
public void TestWorldItemSAPacket()
{
Serial serial = (Serial)0x1024;
var serial = (Serial)0x1024;
ushort itemId = 1;
// Move to fixture
@ -81,7 +81,7 @@ public class ItemPacketTests
[Fact]
public void TestWorldItemHSPacket()
{
Serial serial = (Serial)0x1024;
var serial = (Serial)0x1024;
var itemId = 1;
// Move to fixture

View file

@ -21,7 +21,7 @@ namespace Server.Tests.Network
[Fact]
public void TestPersonalLightLevel()
{
Serial serial = (Serial)0x1024;
var serial = (Serial)0x1024;
byte lightLevel = 5;
var expected = new PersonalLightLevel(serial, lightLevel).Compile();

View file

@ -9,7 +9,7 @@ namespace Server.Tests.Network
[Fact]
public void TestMessageLocalized()
{
Serial serial = (Serial)0x1024;
var serial = (Serial)0x1024;
var graphic = 0x100;
var messageType = MessageType.Label;
var hue = 1024;
@ -48,7 +48,7 @@ namespace Server.Tests.Network
[Fact]
public void TestMessageLocalizedAffix()
{
Serial serial = (Serial)0x1024;
var serial = (Serial)0x1024;
var graphic = 0x100;
var messageType = MessageType.Label;
var hue = 1024;
@ -93,7 +93,7 @@ namespace Server.Tests.Network
[Fact]
public void TestAsciiMessage()
{
Serial serial = (Serial)0x1024;
var serial = (Serial)0x1024;
var graphic = 0x100;
var messageType = MessageType.Label;
var hue = 1024;
@ -131,7 +131,7 @@ namespace Server.Tests.Network
[Fact]
public void TestUnicodeMessage()
{
Serial serial = (Serial)0x1024;
var serial = (Serial)0x1024;
var graphic = 0x100;
var messageType = MessageType.Label;
var hue = 1024;
@ -171,8 +171,8 @@ namespace Server.Tests.Network
[Fact]
public void TestFollowMessage()
{
Serial serial = (Serial)0x1024;
Serial serial2 = (Serial)0x2;
var serial = (Serial)0x1024;
var serial2 = (Serial)0x2;
var expected = new FollowMessage(serial, serial2).Compile();
@ -186,7 +186,7 @@ namespace Server.Tests.Network
[Fact]
public void TestObjectHelpResponse()
{
Serial s = (Serial)0x100;
var s = (Serial)0x100;
var text = "This is some testing text";
var expected = new ObjectHelpResponse(s, text).Compile();

View file

@ -9,8 +9,8 @@ public class MobilePacketTests
[Fact]
public void TestDeathAnimation()
{
Serial killed = (Serial)0x1;
Serial corpse = (Serial)0x1000;
var killed = (Serial)0x1;
var corpse = (Serial)0x1000;
var expected = new DeathAnimation(killed, corpse).Compile();
@ -24,7 +24,7 @@ public class MobilePacketTests
[Fact]
public void TestBondStatus()
{
Serial petSerial = (Serial)0x1;
var petSerial = (Serial)0x1;
const bool bonded = true;
var expected = new BondedStatus(petSerial, bonded).Compile();
@ -79,7 +79,7 @@ public class MobilePacketTests
[InlineData(10, 100, 25, true, false, 0)]
public void TestMobileAnimation(int action, int frameCount, int repeatCount, bool reverse, bool repeat, byte delay)
{
Serial mobile = (Serial)0x1;
var mobile = (Serial)0x1;
var expected = new MobileAnimation(
mobile,
@ -111,7 +111,7 @@ public class MobilePacketTests
[InlineData(10, 100, 20)]
public void TestNewMobileAnimation(int action, int frameCount, byte delay)
{
Serial mobile = (Serial)0x1;
var mobile = (Serial)0x1;
var expected = new NewMobileAnimation(
mobile,
@ -490,7 +490,7 @@ public class MobilePacketTests
[Fact]
public void TestRemoveEntity()
{
Serial e = (Serial)0x1000;
var e = (Serial)0x1000;
var expected = new RemoveEntity(e).Compile();
var ns = PacketTestUtilities.CreateTestNetState();