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

@ -25,20 +25,18 @@ namespace Server.Items
}
[CommandProperty(AccessLevel.GameMaster)]
public bool Protected{ get; set; }
public bool Protected { get; set; }
[CommandProperty(AccessLevel.GameMaster)]
public Rectangle2D Bounds{ get; set; }
public Rectangle2D Bounds { get; set; }
[CommandProperty(AccessLevel.GameMaster)]
public int Width{ get; set; }
public int Width { get; set; }
[CommandProperty(AccessLevel.GameMaster)]
public int Height{ get; set; }
public int Height { get; set; }
public List<Point2D> Pins{ get; } = new List<Point2D>();
#region ICraftable Members
public List<Point2D> Pins { get; } = new List<Point2D>();
public int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool,
CraftItem craftItem, int resHue)
@ -47,8 +45,6 @@ namespace Server.Items
return 1;
}
#endregion
public virtual void CraftInit(Mobile from)
{
}
@ -249,20 +245,20 @@ namespace Server.Items
switch (version)
{
case 0:
{
Bounds = reader.ReadRect2D();
{
Bounds = reader.ReadRect2D();
Width = reader.ReadInt();
Height = reader.ReadInt();
Width = reader.ReadInt();
Height = reader.ReadInt();
Protected = reader.ReadBool();
Protected = reader.ReadBool();
int count = reader.ReadInt();
for (int i = 0; i < count; i++)
Pins.Add(reader.ReadPoint2D());
int count = reader.ReadInt();
for (int i = 0; i < count; i++)
Pins.Add(reader.ReadPoint2D());
break;
}
break;
}
}
}
@ -311,14 +307,14 @@ namespace Server.Items
{
public MapDetails(MapItem map) : base(0x90, 19)
{
m_Stream.Write(map.Serial);
m_Stream.Write((short)0x139D);
m_Stream.Write((short)map.Bounds.Start.X);
m_Stream.Write((short)map.Bounds.Start.Y);
m_Stream.Write((short)map.Bounds.End.X);
m_Stream.Write((short)map.Bounds.End.Y);
m_Stream.Write((short)map.Width);
m_Stream.Write((short)map.Height);
Stream.Write(map.Serial);
Stream.Write((short)0x139D);
Stream.Write((short)map.Bounds.Start.X);
Stream.Write((short)map.Bounds.Start.Y);
Stream.Write((short)map.Bounds.End.X);
Stream.Write((short)map.Bounds.End.Y);
Stream.Write((short)map.Width);
Stream.Write((short)map.Height);
}
}
@ -344,11 +340,11 @@ namespace Server.Items
{
public MapCommand(MapItem map, int command, int number, int x, int y) : base(0x56, 11)
{
m_Stream.Write(map.Serial);
m_Stream.Write((byte)command);
m_Stream.Write((byte)number);
m_Stream.Write((short)x);
m_Stream.Write((short)y);
Stream.Write(map.Serial);
Stream.Write((byte)command);
Stream.Write((byte)number);
Stream.Write((short)x);
Stream.Write((short)y);
}
}

View file

@ -52,10 +52,10 @@ namespace Server.Items
switch (version)
{
case 0:
{
m_LabelNumber = reader.ReadInt();
break;
}
{
m_LabelNumber = reader.ReadInt();
break;
}
}
}
}
@ -70,15 +70,15 @@ namespace Server.Items
Bounds = new Rectangle2D(xLeft, yTop, xRight - xLeft, yBottom - yTop);
}
public int Name{ get; }
public int Name { get; }
public int Width{ get; }
public int Width { get; }
public int Height{ get; }
public int Height { get; }
public Rectangle2D Bounds{ get; }
public Rectangle2D Bounds { get; }
public static PresetMapEntry[] Table{ get; } =
public static PresetMapEntry[] Table { get; } =
{
new PresetMapEntry(1041189, 200, 200, 1092, 1396, 1736, 1924), // map of Britain
new PresetMapEntry(1041203, 200, 200, 0256, 1792, 1736, 2560), // map of Britain to Skara Brae

View file

@ -18,7 +18,7 @@ namespace Server.Items
private static Point2D[] m_Locations;
private static Point2D[] m_HavenLocations;
private static Type[][] m_SpawnTypes =
private static readonly Type[][] m_SpawnTypes =
{
new[] { typeof(HeadlessOne), typeof(Skeleton) },
new[] { typeof(Mongbat), typeof(Ratman), typeof(HeadlessOne), typeof(Skeleton), typeof(Zombie) },
@ -139,7 +139,7 @@ namespace Server.Items
}
[CommandProperty(AccessLevel.GameMaster)]
public Point2D ChestLocation{ get; set; }
public Point2D ChestLocation { get; set; }
public override int LabelNumber
{
@ -312,7 +312,7 @@ namespace Server.Items
from.SendLocalizedMessage(1046447); // Only a young player may use this treasure map.
}
/*
else if ( from != m_Decoder )
else if (from != m_Decoder)
{
from.SendLocalizedMessage( 503016 ); // Only the person who decoded this map may actually dig up the treasure.
}
@ -528,24 +528,24 @@ namespace Server.Items
switch (version)
{
case 1:
{
m_CompletedBy = reader.ReadMobile();
{
m_CompletedBy = reader.ReadMobile();
goto case 0;
}
goto case 0;
}
case 0:
{
m_Level = reader.ReadInt();
m_Completed = reader.ReadBool();
m_Decoder = reader.ReadMobile();
m_Map = reader.ReadMap();
ChestLocation = reader.ReadPoint2D();
{
m_Level = reader.ReadInt();
m_Completed = reader.ReadBool();
m_Decoder = reader.ReadMobile();
m_Map = reader.ReadMap();
ChestLocation = reader.ReadPoint2D();
if (version == 0 && m_Completed)
m_CompletedBy = m_Decoder;
if (version == 0 && m_Completed)
m_CompletedBy = m_Decoder;
break;
}
break;
}
}
if (Core.AOS && m_Decoder != null && LootType == LootType.Regular)
@ -554,7 +554,7 @@ namespace Server.Items
private class DigTarget : Target
{
private TreasureMap m_Map;
private readonly TreasureMap m_Map;
public DigTarget(TreasureMap map) : base(6, true, TargetFlags.None) => m_Map = map;
@ -570,7 +570,7 @@ namespace Server.Items
from.SendLocalizedMessage(503028); // The treasure for this map has already been found.
}
/*
else if ( from != m_Map.m_Decoder )
else if (from != m_Map.m_Decoder)
{
from.SendLocalizedMessage( 503016 ); // Only the person who decoded this map may actually dig up the treasure.
}
@ -679,16 +679,16 @@ namespace Server.Items
private TreasureChestDirt m_Dirt1;
private TreasureChestDirt m_Dirt2;
private Mobile m_From;
private long m_LastMoveTime;
private readonly Mobile m_From;
private readonly long m_LastMoveTime;
private Point3D m_Location;
private Map m_Map;
private long m_NextActionTime;
private readonly Map m_Map;
private readonly long m_NextActionTime;
private long m_NextSkillTime;
private long m_NextSpellTime;
private TreasureMap m_TreasureMap;
private readonly long m_NextSkillTime;
private readonly long m_NextSpellTime;
private readonly TreasureMap m_TreasureMap;
public DigTimer(Mobile from, TreasureMap treasureMap, Point3D location, Map map) : base(TimeSpan.Zero,
TimeSpan.FromSeconds(1.0))
@ -827,8 +827,8 @@ namespace Server.Items
private class SoundTimer : Timer
{
private Mobile m_From;
private int m_SoundID;
private readonly Mobile m_From;
private readonly int m_SoundID;
public SoundTimer(Mobile from, int soundID) : base(TimeSpan.FromSeconds(0.9))
{
@ -847,7 +847,7 @@ namespace Server.Items
private class DecodeMapEntry : ContextMenuEntry
{
private TreasureMap m_Map;
private readonly TreasureMap m_Map;
public DecodeMapEntry(TreasureMap map) : base(6147, 2) => m_Map = map;
@ -860,7 +860,7 @@ namespace Server.Items
private class OpenMapEntry : ContextMenuEntry
{
private TreasureMap m_Map;
private readonly TreasureMap m_Map;
public OpenMapEntry(TreasureMap map) : base(6150, 2) => m_Map = map;
@ -873,7 +873,7 @@ namespace Server.Items
private class DigEntry : ContextMenuEntry
{
private TreasureMap m_Map;
private readonly TreasureMap m_Map;
public DigEntry(TreasureMap map, bool enabled) : base(6148, 2)
{