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

@ -4,27 +4,11 @@ namespace Server.Engines.MLQuests
{
public class QuestArea
{
private TextDefinition m_Name; // So we can add custom names, different from the Region name
private string m_RegionName;
private Map m_ForceMap;
public TextDefinition Name { get; set; }
public TextDefinition Name
{
get => m_Name;
set => m_Name = value;
}
public string RegionName { get; set; }
public string RegionName
{
get => m_RegionName;
set => m_RegionName = value;
}
public Map ForceMap
{
get => m_ForceMap;
set => m_ForceMap = value;
}
public Map ForceMap { get; set; }
public QuestArea( TextDefinition name, string region )
: this( name, region, null )
@ -33,9 +17,9 @@ namespace Server.Engines.MLQuests
public QuestArea( TextDefinition name, string region, Map forceMap )
{
m_Name = name;
m_RegionName = region;
m_ForceMap = forceMap;
Name = name;
RegionName = region;
ForceMap = forceMap;
if ( MLQuestSystem.Debug )
ValidationQueue<QuestArea>.Add( this );
@ -48,10 +32,10 @@ namespace Server.Engines.MLQuests
public bool Contains( Region reg )
{
if ( reg == null || ( m_ForceMap != null && reg.Map != m_ForceMap ) )
if ( reg == null || ( ForceMap != null && reg.Map != ForceMap ) )
return false;
return reg.IsPartOf( m_RegionName );
return reg.IsPartOf( RegionName );
}
// Debug method
@ -61,7 +45,7 @@ namespace Server.Engines.MLQuests
foreach ( Region r in Region.Regions )
{
if ( r.Name == m_RegionName && ( m_ForceMap == null || r.Map == m_ForceMap ) )
if ( r.Name == RegionName && ( ForceMap == null || r.Map == ForceMap ) )
{
found = true;
break;
@ -69,7 +53,7 @@ namespace Server.Engines.MLQuests
}
if ( !found )
Console.WriteLine( "Warning: QuestArea region '{0}' does not exist (ForceMap = {1})", m_RegionName, ( m_ForceMap == null ) ? "-null-" : m_ForceMap.ToString() );
Console.WriteLine( "Warning: QuestArea region '{0}' does not exist (ForceMap = {1})", RegionName, ( ForceMap == null ) ? "-null-" : ForceMap.ToString() );
}
}
}