Adds style cop (#109)

This commit is contained in:
Kamron Batman 2020-04-26 00:16:02 -07:00 committed by GitHub
parent 3e715bcb60
commit 556a17aba8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1725 changed files with 33831 additions and 38046 deletions

View file

@ -44,8 +44,8 @@ namespace Server.Items
private class ResurrectEntry : ContextMenuEntry
{
private Item m_Item;
private Mobile m_Mobile;
private readonly Item m_Item;
private readonly Mobile m_Mobile;
public ResurrectEntry(Mobile mobile, Item item) : base(6195, ResurrectRange)
{
@ -63,7 +63,7 @@ namespace Server.Items
private class LockKarmaEntry : ContextMenuEntry
{
private PlayerMobile m_Mobile;
private readonly PlayerMobile m_Mobile;
public LockKarmaEntry(PlayerMobile mobile) : base(mobile.KarmaLocked ? 6197 : 6196, LockRange) => m_Mobile = mobile;
@ -81,7 +81,7 @@ namespace Server.Items
private class TitheEntry : ContextMenuEntry
{
private Mobile m_Mobile;
private readonly Mobile m_Mobile;
public TitheEntry(Mobile mobile) : base(6198, TitheRange)
{

View file

@ -7,7 +7,7 @@ namespace Server.Items
{
public abstract class BaseDoor : Item, ILockable, ITelekinesisable
{
private static Point3D[] m_Offsets =
private static readonly Point3D[] m_Offsets =
{
new Point3D(-1, 1, 0),
new Point3D(1, 1, 0),
@ -74,19 +74,19 @@ namespace Server.Items
}
[CommandProperty(AccessLevel.GameMaster)]
public int OpenedID{ get; set; }
public int OpenedID { get; set; }
[CommandProperty(AccessLevel.GameMaster)]
public int ClosedID{ get; set; }
public int ClosedID { get; set; }
[CommandProperty(AccessLevel.GameMaster)]
public int OpenedSound{ get; set; }
public int OpenedSound { get; set; }
[CommandProperty(AccessLevel.GameMaster)]
public int ClosedSound{ get; set; }
public int ClosedSound { get; set; }
[CommandProperty(AccessLevel.GameMaster)]
public Point3D Offset{ get; set; }
public Point3D Offset { get; set; }
[CommandProperty(AccessLevel.GameMaster)]
public BaseDoor Link
@ -104,10 +104,10 @@ namespace Server.Items
public virtual bool UseChainedFunctionality => false;
[CommandProperty(AccessLevel.GameMaster)]
public bool Locked{ get; set; }
public bool Locked { get; set; }
[CommandProperty(AccessLevel.GameMaster)]
public uint KeyValue{ get; set; }
public uint KeyValue { get; set; }
public void OnTelekinesis(Mobile from)
{
@ -376,7 +376,7 @@ namespace Server.Items
{
from.LocalOverheadMessage(MessageType.Regular, 0x3B2,
502502); // That is locked, but you open it with your godly powers.
//from.Send( new MessageLocalized( Serial, ItemID, MessageType.Regular, 0x3B2, 3, 502502, "", "" ) ); // That is locked, but you open it with your godly powers.
// from.Send( new MessageLocalized( Serial, ItemID, MessageType.Regular, 0x3B2, 3, 502502, "", "" ) ); // That is locked, but you open it with your godly powers.
}
else if (Key.ContainsKey(from.Backpack, KeyValue))
{
@ -470,30 +470,30 @@ namespace Server.Items
switch (version)
{
case 0:
{
KeyValue = reader.ReadUInt();
m_Open = reader.ReadBool();
Locked = reader.ReadBool();
OpenedID = reader.ReadInt();
ClosedID = reader.ReadInt();
OpenedSound = reader.ReadInt();
ClosedSound = reader.ReadInt();
Offset = reader.ReadPoint3D();
m_Link = reader.ReadItem() as BaseDoor;
{
KeyValue = reader.ReadUInt();
m_Open = reader.ReadBool();
Locked = reader.ReadBool();
OpenedID = reader.ReadInt();
ClosedID = reader.ReadInt();
OpenedSound = reader.ReadInt();
ClosedSound = reader.ReadInt();
Offset = reader.ReadPoint3D();
m_Link = reader.ReadItem() as BaseDoor;
m_Timer = new InternalTimer(this);
m_Timer = new InternalTimer(this);
if (m_Open)
m_Timer.Start();
if (m_Open)
m_Timer.Start();
break;
}
break;
}
}
}
private class InternalTimer : Timer
{
private BaseDoor m_Door;
private readonly BaseDoor m_Door;
public InternalTimer(BaseDoor door) : base(TimeSpan.FromSeconds(20.0), TimeSpan.FromSeconds(10.0))
{

View file

@ -11,7 +11,7 @@ namespace Server.Items
SouthCCW,
NorthCW,
//Sliding Doors
// Sliding Doors
SouthSW,
SouthSE,
WestSS,

View file

@ -102,10 +102,10 @@ namespace Server.Items
}
[CommandProperty(AccessLevel.GameMaster)]
public DoorFacing Facing{ get; set; }
public DoorFacing Facing { get; set; }
[CommandProperty(AccessLevel.GameMaster)]
public SecureLevel Level{ get; set; }
public SecureLevel Level { get; set; }
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
{
@ -182,18 +182,18 @@ namespace Server.Items
switch (version)
{
case 1:
{
Level = (SecureLevel)reader.ReadInt();
goto case 0;
}
{
Level = (SecureLevel)reader.ReadInt();
goto case 0;
}
case 0:
{
if (version < 1)
Level = SecureLevel.Anyone;
{
if (version < 1)
Level = SecureLevel.Anyone;
Facing = (DoorFacing)reader.ReadInt();
break;
}
Facing = (DoorFacing)reader.ReadInt();
break;
}
}
}
@ -239,7 +239,7 @@ namespace Server.Items
h = bs;
break;
//No way to test the 'insideness' of SE Sliding doors on OSI, so leaving them default to false until further information gained
// No way to test the 'insideness' of SE Sliding doors on OSI, so leaving them default to false until further information gained
default: return false;
}

View file

@ -45,10 +45,10 @@ namespace Server.Items
switch (version)
{
case 0:
{
m_LabelNumber = reader.ReadInt();
break;
}
{
m_LabelNumber = reader.ReadInt();
break;
}
}
}
}