Skip to content

Commit 7a2ffb8

Browse files
committed
move shit around
1 parent 421eab2 commit 7a2ffb8

15 files changed

Lines changed: 71 additions & 46 deletions

File tree

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ dotnet_naming_rule.instance_fields_should_be_camel_case.style = instance_field_s
116116
dotnet_naming_symbols.instance_fields.applicable_kinds = field
117117

118118
dotnet_naming_style.instance_field_style.capitalization = camel_case
119-
dotnet_naming_style.instance_field_style.required_prefix = _
119+
dotnet_naming_style.instance_field_style.required_prefix =
120120

121121
# Locals and parameters are camelCase
122122
dotnet_naming_rule.locals_should_be_camel_case.severity = suggestion

examples/TestPlugin/Plugin.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ internal sealed class MessagesSection
8686
}
8787

8888
private void Greet(ICommandContext context) =>
89-
context.Sender?.SendChat(this.Localizer.ForPlayer(context.Sender, "hello"));
89+
context.Sender?.SendChat(this.Localizer.Localize(context.Sender, "hello"));
9090

9191
private void ReloadConfigs(ICommandContext context)
9292
{

examples/TestPlugin/TestService.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ namespace TestPlugin;
66
using SwiftlyS2.Shared.Players;
77

88
public sealed class TestService(
9-
ISwiftlyCore core,
10-
IPluginLogger logger,
11-
ITranslate localizer)
9+
ISwiftlyCore core,
10+
IPluginLogger logger,
11+
ITranslate localizer)
1212
{
13-
public void Run() => logger.Info("SwDevtools DI smoke test for {0}", core.GetType().Name);
13+
public void Run() => logger.Info("SwDevtools DI smoke test for {0}", core.GetType().Name);
1414

15-
public void Greet(IPlayer player) =>
16-
player.SendChat(localizer.ForPlayer(player, "hello"));
15+
public void Greet(IPlayer player) =>
16+
player.SendChat(localizer.Localize(player, "hello"));
1717
}

src/Injection/ServiceCollectionExtensions.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,37 +29,37 @@ public static IServiceCollection AddSwDevtoolsKit(this IServiceCollection self,
2929
.Services;
3030
}
3131

32-
public static Is2PluginBuilder AddSwDevtoolsCore(this IServiceCollection services, ISwiftlyCore core,
32+
public static ISwDevtoolsBuilder AddSwDevtoolsCore(this IServiceCollection services, ISwiftlyCore core,
3333
object pluginInstance, string? pluginName = null)
3434
{
3535
var (assembly, name) = ResolvePlugin(pluginInstance, pluginName);
3636
return services.AddSwDevtoolsCore(core, assembly, name);
3737
}
3838

39-
public static Is2PluginBuilder AddSwDevtoolsCore(this IServiceCollection self, ISwiftlyCore core,
39+
public static ISwDevtoolsBuilder AddSwDevtoolsCore(this IServiceCollection self, ISwiftlyCore core,
4040
Assembly pluginAssembly, string? pluginName = null)
4141
{
4242
var resolvedName = pluginName ?? SwDevtoolsFactory.ResolvePluginName(pluginAssembly);
4343
self.TryAddSingleton(core);
4444
self.TryAddSingleton(new PluginIdentity(resolvedName, pluginAssembly));
4545

46-
return new S2PluginBuilder(self, core, pluginAssembly, resolvedName);
46+
return new SwDevtoolsBuilder(self, core, pluginAssembly, resolvedName);
4747
}
4848

49-
public static Is2PluginBuilder AddSwDevtoolsConfig(this Is2PluginBuilder builder)
49+
public static ISwDevtoolsBuilder AddSwDevtoolsConfig(this ISwDevtoolsBuilder builder)
5050
{
5151
builder.Services.TryAddSingleton<IJsonConfig>(_ => JsonConfig.Shared(builder.Core));
5252
return builder;
5353
}
5454

55-
public static Is2PluginBuilder AddSwDevtoolsTranslation(this Is2PluginBuilder builder)
55+
public static ISwDevtoolsBuilder AddSwDevtoolsTranslation(this ISwDevtoolsBuilder builder)
5656
{
5757
builder.Services.TryAddSingleton<TranslateService>();
5858
builder.Services.TryAddSingleton<ITranslate>(sp => sp.GetRequiredService<TranslateService>());
5959
return builder;
6060
}
6161

62-
public static Is2PluginBuilder AddSwDevtoolsLogging(this Is2PluginBuilder builder)
62+
public static ISwDevtoolsBuilder AddSwDevtoolsLogging(this ISwDevtoolsBuilder builder)
6363
{
6464
builder.Services.TryAddSingleton(_ => SwDevtoolsFactory.GetLoggerFactory(builder.Core));
6565
builder.Services.TryAddSingleton(_ => SwDevtoolsFactory.GetLogger(builder.Core, builder.PluginName));
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ namespace SwDevtools.Injection;
44
using Microsoft.Extensions.DependencyInjection;
55
using SwiftlyS2.Shared;
66

7-
public interface Is2PluginBuilder
7+
public interface ISwDevtoolsBuilder
88
{
99
IServiceCollection Services { get; }
1010
ISwiftlyCore Core { get; }
1111
Assembly PluginAssembly { get; }
1212
string PluginName { get; }
1313
}
1414

15-
internal sealed class S2PluginBuilder(
15+
internal sealed class SwDevtoolsBuilder(
1616
IServiceCollection services,
1717
ISwiftlyCore core,
1818
Assembly pluginAssembly,
19-
string pluginName) : Is2PluginBuilder
19+
string pluginName) : ISwDevtoolsBuilder
2020
{
2121
public IServiceCollection Services => services;
2222
public ISwiftlyCore Core => core;

src/Players/Translate/TranslateService.cs

Lines changed: 0 additions & 29 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)