Removes redundant delegate type declarations

This commit is contained in:
Kamron Batman 2018-09-14 14:32:04 -07:00
parent 3c9842ee5a
commit c85b0a740c
317 changed files with 898 additions and 903 deletions

View file

@ -723,7 +723,7 @@ namespace Server.Engines.Craft
if ( IsQuantityType( types ) )
index = ConsumeQuantity( ourPack, types, amounts );
else
index = ourPack.ConsumeTotalGrouped( types, amounts, true, new OnItemConsumed( OnResourceConsumed ), new CheckItemGroup( CheckHueGrouping ) );
index = ourPack.ConsumeTotalGrouped( types, amounts, true, OnResourceConsumed, CheckHueGrouping );
resHue = m_ResHue;
}
@ -744,7 +744,7 @@ namespace Server.Engines.Craft
if ( IsQuantityType( types ) )
index = ConsumeQuantity( ourPack, types, amounts );
else
index = ourPack.ConsumeTotalGrouped( types, amounts, true, new OnItemConsumed( OnResourceConsumed ), new CheckItemGroup( CheckHueGrouping ) );
index = ourPack.ConsumeTotalGrouped( types, amounts, true, OnResourceConsumed, CheckHueGrouping );
resHue = m_ResHue;
}
@ -768,7 +768,7 @@ namespace Server.Engines.Craft
{
for ( int i = 0; i < types.Length; i++ )
{
if ( ourPack.GetBestGroupAmount( types[i], true, new CheckItemGroup( CheckHueGrouping ) ) < amounts[i] )
if ( ourPack.GetBestGroupAmount( types[i], true, CheckHueGrouping ) < amounts[i] )
{
index = i;
break;

View file

@ -9,8 +9,8 @@ namespace Server.Engines.Craft
{
public static void Initialize()
{
CommandSystem.Register( "LearnAllRecipes", AccessLevel.GameMaster, new CommandEventHandler( LearnAllRecipes_OnCommand ) );
CommandSystem.Register( "ForgetAllRecipes", AccessLevel.GameMaster, new CommandEventHandler( ForgetAllRecipes_OnCommand ) );
CommandSystem.Register( "LearnAllRecipes", AccessLevel.GameMaster, LearnAllRecipes_OnCommand );
CommandSystem.Register( "ForgetAllRecipes", AccessLevel.GameMaster, ForgetAllRecipes_OnCommand );
}
[Usage( "LearnAllRecipes" )]
@ -20,22 +20,20 @@ namespace Server.Engines.Craft
Mobile m = e.Mobile;
m.SendMessage( "Target a player to teach them all of the recipies." );
m.BeginTarget( -1, false, Targeting.TargetFlags.None, new TargetCallback(
delegate( Mobile from, object targeted )
m.BeginTarget( -1, false, Targeting.TargetFlags.None, delegate( Mobile from, object targeted )
{
if ( targeted is PlayerMobile mobile )
{
if ( targeted is PlayerMobile mobile )
{
foreach( KeyValuePair<int, Recipe> kvp in m_Recipes )
mobile.AcquireRecipe( kvp.Key );
foreach( KeyValuePair<int, Recipe> kvp in m_Recipes )
mobile.AcquireRecipe( kvp.Key );
m.SendMessage( "You teach them all of the recipies." );
}
else
{
m.SendMessage( "That is not a player!" );
}
m.SendMessage( "You teach them all of the recipies." );
}
) );
else
{
m.SendMessage( "That is not a player!" );
}
} );
}
[Usage( "ForgetAllRecipes" )]
@ -45,21 +43,19 @@ namespace Server.Engines.Craft
Mobile m = e.Mobile;
m.SendMessage( "Target a player to have them forget all of the recipies they've learned." );
m.BeginTarget( -1, false, Targeting.TargetFlags.None, new TargetCallback(
delegate( Mobile from, object targeted )
m.BeginTarget( -1, false, Targeting.TargetFlags.None, delegate( Mobile from, object targeted )
{
if ( targeted is PlayerMobile mobile )
{
if ( targeted is PlayerMobile mobile )
{
mobile.ResetRecipes();
mobile.ResetRecipes();
m.SendMessage( "They forget all their recipies." );
}
else
{
m.SendMessage( "That is not a player!" );
}
m.SendMessage( "They forget all their recipies." );
}
) );
else
{
m.SendMessage( "That is not a player!" );
}
} );
}