Changes properties to use automatic property initializers

This commit is contained in:
Kamron Batman 2018-09-14 15:23:29 -07:00
parent f0a48ad431
commit 06fa31a7bf
623 changed files with 13072 additions and 19304 deletions

View file

@ -229,9 +229,7 @@ namespace Server.Mobiles
return false;
}
private static Hashtable m_EscortTable = new Hashtable();
public static Hashtable EscortTable => m_EscortTable;
public static Hashtable EscortTable { get; } = new Hashtable();
public virtual bool AcceptEscorter(Mobile m)
{
@ -245,7 +243,7 @@ namespace Server.Mobiles
if (escorter != null || !m.Alive)
return false;
BaseEscortable escortable = (BaseEscortable)m_EscortTable[m];
BaseEscortable escortable = (BaseEscortable)EscortTable[m];
if (escortable != null && !escortable.Deleted && escortable.GetEscorter() == m)
{
@ -268,7 +266,7 @@ namespace Server.Mobiles
((PlayerMobile)m).LastEscortTime = DateTime.UtcNow;
Say("Lead on! Payment will be made when we arrive in {0}.", (dest.Name == "Ocllo" && m.Map == Map.Trammel) ? "Haven" : dest.Name);
m_EscortTable[m] = this;
EscortTable[m] = this;
StartFollow();
return true;
}
@ -387,7 +385,7 @@ namespace Server.Mobiles
Say(1005653); // Hmmm. I seem to have lost my master.
SetControlMaster(null);
m_EscortTable.Remove(master);
EscortTable.Remove(master);
Timer.DelayCall(TimeSpan.FromSeconds(5.0), Delete);
return null;
@ -449,7 +447,7 @@ namespace Server.Mobiles
StopFollow();
SetControlMaster(null);
m_EscortTable.Remove(escorter);
EscortTable.Remove(escorter);
BeginDelete();
Misc.Titles.AwardFame(escorter, 10, true);
@ -645,13 +643,11 @@ namespace Server.Mobiles
public class EscortDestinationInfo
{
private string m_Name;
private Region m_Region;
//private Rectangle2D[] m_Bounds;
public string Name => m_Name;
public string Name { get; }
public Region Region => m_Region;
public Region Region { get; }
/*public Rectangle2D[] Bounds
{
@ -660,13 +656,13 @@ namespace Server.Mobiles
public bool Contains(Point3D p)
{
return m_Region.Contains(p);
return Region.Contains(p);
}
public EscortDestinationInfo(string name, Region region)
{
m_Name = name;
m_Region = region;
Name = name;
Region = region;
}
private static Hashtable m_Table;