Skip to content
Permalink
Browse files

Code cleanup

  • Loading branch information
Trojaner committed Feb 26, 2019
1 parent caa5b8e commit 93723cf5aa3f1ff9f4afb77a2f107133177aeedd
@@ -145,6 +145,6 @@ public interface IEconomyProvider: IService
/// <summary>
/// Checks if the provider supports multiple accounts per user.
/// </summary>
Task<bool> SupportsMultipleAccountsAsync { get; }
bool SupportsMultipleAccounts { get; }
}
}
@@ -12,7 +12,6 @@ public class CommandContext : ICommandContext
{
public CommandContext(IDependencyContainer container,
IUser user,
IPlayer player,
string commandPrefix,
ICommand command,
string commandAlias,
@@ -22,7 +21,6 @@ public class CommandContext : ICommandContext
{
Container = container;
User = user;
Player = player;
Command = command;
CommandAlias = commandAlias;
ParentContext = parentCommandContext;
@@ -33,7 +31,6 @@ public class CommandContext : ICommandContext

public ICommand Command { get; internal set; }
public IUser User { get; }
public IPlayer Player { get; }
public ICommandContext ChildContext { get; internal set; }
public ICommandContext ParentContext { get; }
public ICommandContext RootContext { get; }
@@ -26,17 +26,7 @@ public DefaultCommandHandler(IDependencyContainer container)
this.container = container;
}

public Task<bool> HandleCommandAsync(IPlayer player, string commandLine, string prefix)
{
return HandleCommandAsync(player.User, player, commandLine, prefix);
}

public Task<bool> HandleCommandAsync(IUser user, string commandLine, string prefix)
{
return HandleCommandAsync(user,null, commandLine, prefix);
}

public async Task<bool> HandleCommandAsync(IUser user,IPlayer player,string commandLine, string prefix)
public async Task<bool> HandleCommandAsync(IUser user, string commandLine, string prefix)
{
GuardUser(user);

@@ -50,7 +40,7 @@ public async Task<bool> HandleCommandAsync(IUser user,IPlayer player,string comm
contextContainer.Resolve<ILogger>().LogInformation($"{user.ToString()} executed command: \"{commandLine}\"");

CommandContext context = new CommandContext(contextContainer,
user,player, prefix, null,
user,prefix, null,
args[0], args.Skip(1).ToArray(), null, null);

ICommand target = context.Container.Resolve<ICommandProvider>()
@@ -139,7 +129,6 @@ private CommandContext GetChild(CommandContext root, CommandContext context, Lis
CommandContext childContext = new CommandContext(
context.Container.CreateChildContainer(),
context.User,
context.Player,
context.CommandPrefix + context.CommandAlias + " ",
cmd,
alias,
@@ -77,6 +77,7 @@
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpRenamePlacementToArrangementMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpUseContinuousIndentInsideBracesMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EAddAccessorOwnerDeclarationBracesMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002ECSharpPlaceAttributeOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>

0 comments on commit 93723cf

Please sign in to comment.
You can’t perform that action at this time.