Upgrades code style - First batch (#22)

This commit is contained in:
Kamron Batman 2018-08-14 06:16:50 +08:00 committed by GitHub
parent 8ee42c8ea2
commit 632e8b4757
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1834 changed files with 10245 additions and 10437 deletions

View file

@ -18,7 +18,7 @@ namespace Server.Engines.MLQuests
{
public static class MLQuestSystem
{
public static bool Enabled { get { return Core.ML; } }
public static bool Enabled => Core.ML;
public const int MaxConcurrentQuests = 10;
public const int SpeechColor = 0x3B2;
@ -120,9 +120,7 @@ namespace Server.Engines.MLQuests
private static void RegisterQuestGiver( MLQuest quest, Type questerType )
{
List<MLQuest> questList;
if ( !m_QuestGivers.TryGetValue( questerType, out questList ) )
if (!m_QuestGivers.TryGetValue( questerType, out List<MLQuest> questList ))
m_QuestGivers[questerType] = questList = new List<MLQuest>();
questList.Add( quest );
@ -254,9 +252,8 @@ namespace Server.Engines.MLQuests
}
Type index = ScriptCompiler.FindTypeByName( e.GetString( 0 ) );
MLQuest quest;
if ( index == null || !m_Quests.TryGetValue( index, out quest ) )
if ( index == null || !m_Quests.TryGetValue( index, out MLQuest quest ) )
{
m.SendMessage( "Invalid quest type name." );
return;
@ -590,17 +587,14 @@ namespace Server.Engines.MLQuests
public static MLQuestContext GetContext( PlayerMobile pm )
{
MLQuestContext context;
m_Contexts.TryGetValue( pm, out context );
m_Contexts.TryGetValue( pm, out MLQuestContext context );
return context;
}
public static MLQuestContext GetOrCreateContext( PlayerMobile pm )
{
MLQuestContext context;
if ( !m_Contexts.TryGetValue( pm, out context ) )
if (!m_Contexts.TryGetValue( pm, out MLQuestContext context ))
m_Contexts[pm] = context = new MLQuestContext( pm );
return context;
@ -763,20 +757,14 @@ namespace Server.Engines.MLQuests
public static MLQuest FindQuest( Type questType )
{
MLQuest result;
m_Quests.TryGetValue( questType, out result );
m_Quests.TryGetValue( questType, out MLQuest result );
return result;
}
public static List<MLQuest> FindQuestList( Type questerType )
{
List<MLQuest> result;
if ( m_QuestGivers.TryGetValue( questerType, out result ) )
return result;
return EmptyList;
return m_QuestGivers.TryGetValue(questerType, out List<MLQuest> result) ? result : EmptyList;
}
}
}