Use file-scoped namespaces

This commit is contained in:
Liza 2023-03-30 22:01:43 +02:00
parent 0b07e8b8f6
commit 8042aee951
76 changed files with 4771 additions and 4841 deletions

View File

@ -21,7 +21,7 @@ resharper_indent_text = ZeroIndent
csharp_style_expression_bodied_methods = true
# namespaces
csharp_style_namespace_declarations = block_scoped
csharp_style_namespace_declarations = file_scoped
# braces
csharp_prefer_braces = when_multiline

View File

@ -1,10 +1,9 @@
using System;
using System.Collections.Generic;
namespace Pal.Client.Commands
{
namespace Pal.Client.Commands;
public interface ISubCommand
{
IReadOnlyDictionary<string, Action<string>> GetHandlers();
}
}

View File

@ -3,8 +3,8 @@ using System.Collections.Generic;
using Pal.Client.Configuration;
using Pal.Client.Windows;
namespace Pal.Client.Commands
{
namespace Pal.Client.Commands;
internal class PalConfigCommand : ISubCommand
{
private readonly IPalacePalConfiguration _configuration;
@ -37,4 +37,3 @@ namespace Pal.Client.Commands
_configWindow.Toggle();
}
}
}

View File

@ -7,8 +7,8 @@ using Pal.Client.Extensions;
using Pal.Client.Floors;
using Pal.Client.Rendering;
namespace Pal.Client.Commands
{
namespace Pal.Client.Commands;
internal sealed class PalNearCommand : ISubCommand
{
private readonly Chat _chat;
@ -60,4 +60,3 @@ namespace Pal.Client.Commands
$"{nearbyMarker.distance:F2} - {nearbyMarker.m.Type} {nearbyMarker.m.NetworkId?.ToPartialId(length: 8)} - {nearbyMarker.m.Position}");
}
}
}

View File

@ -2,8 +2,8 @@
using System.Collections.Generic;
using Pal.Client.DependencyInjection;
namespace Pal.Client.Commands
{
namespace Pal.Client.Commands;
internal sealed class PalStatsCommand : ISubCommand
{
private readonly StatisticsService _statisticsService;
@ -22,4 +22,3 @@ namespace Pal.Client.Commands
private void Execute()
=> _statisticsService.ShowGlobalStatistics();
}
}

View File

@ -3,8 +3,8 @@ using System.Collections.Generic;
using ECommons.Schedulers;
using Pal.Client.Windows;
namespace Pal.Client.Commands
{
namespace Pal.Client.Commands;
internal sealed class PalTestConnectionCommand : ISubCommand
{
private readonly ConfigWindow _configWindow;
@ -27,4 +27,3 @@ namespace Pal.Client.Commands
var _ = new TickScheduler(() => _configWindow.TestConnection());
}
}
}

View File

@ -4,8 +4,8 @@ using System.Security.Cryptography;
using System.Text.Json.Serialization;
using Microsoft.Extensions.Logging;
namespace Pal.Client.Configuration
{
namespace Pal.Client.Configuration;
public sealed class AccountConfigurationV7 : IAccountConfiguration
{
private const int DefaultEntropyLength = 16;
@ -146,4 +146,3 @@ namespace Pal.Client.Configuration
ProtectedDataUnsupported = 3,
}
}
}

View File

@ -3,8 +3,8 @@ using System.Linq;
using System.Security.Cryptography;
using Microsoft.Extensions.Logging;
namespace Pal.Client.Configuration
{
namespace Pal.Client.Configuration;
internal static class ConfigurationData
{
private static readonly ILogger _logger =
@ -41,4 +41,3 @@ namespace Pal.Client.Configuration
}
}
}
}

View File

@ -13,8 +13,8 @@ using Pal.Client.Configuration.Legacy;
using Pal.Client.Database;
using NJson = Newtonsoft.Json;
namespace Pal.Client.Configuration
{
namespace Pal.Client.Configuration;
internal sealed class ConfigurationManager
{
private readonly ILogger<ConfigurationManager> _logger;
@ -153,4 +153,3 @@ namespace Pal.Client.Configuration
#pragma warning restore CS0618
#pragma warning restore CS0612
}
}

View File

@ -2,8 +2,8 @@
using System.Collections.Generic;
using System.Linq;
namespace Pal.Client.Configuration
{
namespace Pal.Client.Configuration;
public sealed class ConfigurationV7 : IPalacePalConfiguration, IConfigurationInConfigDirectory
{
public int Version { get; set; } = 7;
@ -51,4 +51,3 @@ namespace Pal.Client.Configuration
return account == null || account.CachedRoles.Contains(role);
}
}
}

View File

@ -1,5 +1,5 @@
namespace Pal.Client.Configuration
{
namespace Pal.Client.Configuration;
public enum EMode
{
/// <summary>
@ -12,4 +12,3 @@
/// </summary>
Offline = 2,
}
}

View File

@ -1,5 +1,5 @@
namespace Pal.Client.Configuration
{
namespace Pal.Client.Configuration;
public enum ERenderer
{
/// <see cref="Rendering.SimpleRenderer"/>
@ -8,4 +8,3 @@
/// <see cref="Rendering.SplatoonRenderer"/>
Splatoon = 1,
}
}

View File

@ -4,8 +4,8 @@ using System.Numerics;
using ImGuiNET;
using Newtonsoft.Json;
namespace Pal.Client.Configuration
{
namespace Pal.Client.Configuration;
public interface IVersioned
{
int Version { get; set; }
@ -108,4 +108,3 @@ namespace Pal.Client.Configuration
public int MinimumBackupsToKeep { get; set; } = 3;
public int DaysToDeleteAfter { get; set; } = 21;
}
}

View File

@ -8,8 +8,8 @@ using Dalamud.Plugin;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
namespace Pal.Client.Configuration.Legacy
{
namespace Pal.Client.Configuration.Legacy;
[Obsolete]
public sealed class ConfigurationV1
{
@ -164,4 +164,3 @@ namespace Pal.Client.Configuration.Legacy
public DateTime ImportedAt { get; set; }
}
}
}

View File

@ -7,8 +7,8 @@ using System.Text.Json;
using Pal.Client.Extensions;
using Pal.Common;
namespace Pal.Client.Configuration.Legacy
{
namespace Pal.Client.Configuration.Legacy;
/// <summary>
/// Legacy JSON file for marker locations.
/// </summary>
@ -159,4 +159,3 @@ namespace Pal.Client.Configuration.Legacy
public HashSet<JsonMarker> Markers { get; set; } = new();
}
}
}

View File

@ -2,8 +2,8 @@
using System.Collections.Generic;
using System.Numerics;
namespace Pal.Client.Configuration.Legacy
{
namespace Pal.Client.Configuration.Legacy;
[Obsolete]
public class JsonMarker
{
@ -23,4 +23,3 @@ namespace Pal.Client.Configuration.Legacy
Debug = 3,
}
}
}

View File

@ -12,8 +12,8 @@ using Microsoft.Extensions.Logging;
using Pal.Client.Database;
using Pal.Common;
namespace Pal.Client.Configuration.Legacy
{
namespace Pal.Client.Configuration.Legacy;
/// <summary>
/// Imports legacy territoryType.json files into the database if it exists, and no markers for that territory exist.
/// </summary>
@ -144,4 +144,3 @@ namespace Pal.Client.Configuration.Legacy
}
#pragma warning restore CS0612
}
}

View File

@ -6,8 +6,8 @@ using Microsoft.Extensions.Logging;
using Pal.Client.Configuration;
using Pal.Common;
namespace Pal.Client.Database
{
namespace Pal.Client.Database;
internal sealed class Cleanup
{
private readonly ILogger<Cleanup> _logger;
@ -64,4 +64,3 @@ namespace Pal.Client.Database
return o => o.Source != ClientLocation.ESource.Download;
}
}
}

View File

@ -1,8 +1,8 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace Pal.Client.Database
{
namespace Pal.Client.Database;
internal sealed class ClientLocation
{
[Key] public int LocalId { get; set; }
@ -56,4 +56,3 @@ namespace Pal.Client.Database
Download = 4,
}
}
}

View File

@ -1,8 +1,8 @@
using System;
using System.Collections.Generic;
namespace Pal.Client.Database
{
namespace Pal.Client.Database;
internal sealed class ImportHistory
{
public Guid Id { get; set; }
@ -12,4 +12,3 @@ namespace Pal.Client.Database
public List<ClientLocation> ImportedLocations { get; set; } = new();
}
}

View File

@ -1,7 +1,7 @@
using Microsoft.EntityFrameworkCore;
namespace Pal.Client.Database
{
namespace Pal.Client.Database;
internal class PalClientContext : DbContext
{
public DbSet<ClientLocation> Locations { get; set; } = null!;
@ -21,4 +21,3 @@ namespace Pal.Client.Database
.UsingEntity(o => o.ToTable("LocationImports"));
}
}
}

View File

@ -2,8 +2,8 @@
using Pal.Client.Extensions;
using Pal.Client.Net;
namespace Pal.Client.Database
{
namespace Pal.Client.Database;
/// <summary>
/// To avoid sending too many requests to the server, we cache which locations have been seen
/// locally. These never expire, and locations which have been seen with a specific account
@ -38,4 +38,3 @@ namespace Pal.Client.Database
AccountId = accountId.ToPartialId();
}
}
}

View File

@ -19,8 +19,8 @@ using Pal.Client.DependencyInjection;
using Pal.Client.Floors;
using Pal.Client.Windows;
namespace Pal.Client
{
namespace Pal.Client;
/// <summary>
/// Takes care of async plugin init - this is mostly everything that requires either the config or the database to
/// be available.
@ -193,4 +193,3 @@ namespace Pal.Client
await dbContext.SaveChangesAsync();
}
}
}

View File

@ -3,8 +3,8 @@ using Dalamud.Game.Text;
using Dalamud.Game.Text.SeStringHandling;
using Pal.Client.Properties;
namespace Pal.Client.DependencyInjection
{
namespace Pal.Client.DependencyInjection;
internal sealed class Chat
{
private readonly ChatGui _chatGui;
@ -35,4 +35,3 @@ namespace Pal.Client.DependencyInjection
public void UnformattedMessage(string message)
=> _chatGui.Print(message);
}
}

View File

@ -8,8 +8,8 @@ using Lumina.Excel.GeneratedSheets;
using Pal.Client.Configuration;
using Pal.Client.Floors;
namespace Pal.Client.DependencyInjection
{
namespace Pal.Client.DependencyInjection;
internal sealed class ChatService : IDisposable
{
private readonly ChatGui _chatGui;
@ -107,4 +107,3 @@ namespace Pal.Client.DependencyInjection
new(@"This isn't a game message, but will be replaced"); // new Regex(@"^Floor (\d+)$");
}
}
}

View File

@ -1,7 +1,7 @@
using System;
namespace Pal.Client.DependencyInjection
{
namespace Pal.Client.DependencyInjection;
internal sealed class DebugState
{
public string? DebugMessage { get; set; }
@ -12,4 +12,3 @@ namespace Pal.Client.DependencyInjection
public void Reset()
=> DebugMessage = null;
}
}

View File

@ -8,8 +8,8 @@ using Dalamud.Utility.Signatures;
using Microsoft.Extensions.Logging;
using Pal.Client.Floors;
namespace Pal.Client.DependencyInjection
{
namespace Pal.Client.DependencyInjection;
internal sealed unsafe class GameHooks : IDisposable
{
private readonly ILogger<GameHooks> _logger;
@ -103,4 +103,3 @@ namespace Pal.Client.DependencyInjection
ActorVfxCreateHook.Dispose();
}
}
}

View File

@ -12,8 +12,8 @@ using Pal.Client.Floors;
using Pal.Client.Floors.Tasks;
using Pal.Common;
namespace Pal.Client.DependencyInjection
{
namespace Pal.Client.DependencyInjection;
internal sealed class ImportService
{
private readonly IServiceProvider _serviceProvider;
@ -163,4 +163,3 @@ namespace Pal.Client.DependencyInjection
}
}
}
}

View File

@ -6,8 +6,8 @@ using Microsoft.Extensions.Logging;
using Pal.Client.Extensions;
using Pal.Client.Properties;
namespace Pal.Client.DependencyInjection
{
namespace Pal.Client.DependencyInjection;
internal sealed class RepoVerification
{
public RepoVerification(ILogger<RepoVerification> logger, DalamudPluginInterface pluginInterface, Chat chat)
@ -27,4 +27,3 @@ namespace Pal.Client.DependencyInjection
{
}
}
}

View File

@ -9,8 +9,8 @@ using Pal.Client.Net;
using Pal.Client.Properties;
using Pal.Client.Windows;
namespace Pal.Client.DependencyInjection
{
namespace Pal.Client.DependencyInjection;
internal sealed class StatisticsService
{
private readonly IPalacePalConfiguration _configuration;
@ -72,4 +72,3 @@ namespace Pal.Client.DependencyInjection
}
}
}
}

View File

@ -25,8 +25,8 @@ using Pal.Client.Rendering;
using Pal.Client.Scheduled;
using Pal.Client.Windows;
namespace Pal.Client
{
namespace Pal.Client;
/// <summary>
/// DI-aware Plugin.
/// </summary>
@ -187,4 +187,3 @@ namespace Pal.Client
SqliteConnection.ClearPool(sqliteConnection);
}
}
}

View File

@ -1,7 +1,7 @@
using System;
namespace Pal.Client.Extensions
{
namespace Pal.Client.Extensions;
public static class GuidExtensions
{
public static string ToPartialId(this Guid g, int length = 13)
@ -10,4 +10,3 @@ namespace Pal.Client.Extensions
public static string ToPartialId(this string s, int length = 13)
=> s.PadRight(length + 1).Substring(0, length);
}
}

View File

@ -3,8 +3,8 @@ using System.Runtime.InteropServices;
using System.Text;
using ImGuiNET;
namespace Pal.Client.Extensions
{
namespace Pal.Client.Extensions;
internal static class PalImGui
{
/// <summary>
@ -33,4 +33,3 @@ namespace Pal.Client.Extensions
choice = value;
}
}
}

View File

@ -1,7 +1,7 @@
using System;
namespace Pal.Client.Floors
{
namespace Pal.Client.Floors;
/// <summary>
/// This is a currently-visible marker.
/// </summary>
@ -26,4 +26,3 @@ namespace Pal.Client.Floors
return $"EphemeralLocation(Position={Position}, Type={Type})";
}
}
}

View File

@ -10,8 +10,8 @@ using Pal.Client.Floors.Tasks;
using Pal.Client.Net;
using Pal.Common;
namespace Pal.Client.Floors
{
namespace Pal.Client.Floors;
internal sealed class FloorService
{
private readonly IPalacePalConfiguration _configuration;
@ -160,4 +160,3 @@ namespace Pal.Client.Floors
}
}
}
}

View File

@ -18,8 +18,8 @@ using Pal.Client.Rendering;
using Pal.Client.Scheduled;
using Pal.Common;
namespace Pal.Client.Floors
{
namespace Pal.Client.Floors;
internal sealed class FrameworkService : IDisposable
{
private readonly IServiceProvider _serviceProvider;
@ -465,4 +465,3 @@ namespace Pal.Client.Floors
handler.RunIfCompatible(queued, ref recreateLayout);
}
}
}

View File

@ -5,8 +5,8 @@ using Pal.Client.Rendering;
using Pal.Common;
using Palace;
namespace Pal.Client.Floors
{
namespace Pal.Client.Floors;
/// <summary>
/// Base class for <see cref="MemoryLocation"/> and <see cref="EphemeralLocation"/>.
/// </summary>
@ -64,4 +64,3 @@ namespace Pal.Client.Floors
};
}
}
}

View File

@ -5,8 +5,8 @@ using Pal.Client.Configuration;
using Pal.Client.Scheduled;
using Pal.Common;
namespace Pal.Client.Floors
{
namespace Pal.Client.Floors;
/// <summary>
/// A single set of floors loaded entirely in memory, can be e.g. POTD 51-60.
/// </summary>
@ -60,4 +60,3 @@ namespace Pal.Client.Floors
Importing,
}
}
}

View File

@ -9,8 +9,8 @@ using Dalamud.Game.Gui;
using Dalamud.Plugin;
using ImGuiNET;
namespace Pal.Client.Floors
{
namespace Pal.Client.Floors;
/// <summary>
/// This isn't very useful for running deep dungeons normally, but it is for plugin dev.
///
@ -98,4 +98,3 @@ namespace Pal.Client.Floors
_pluginInterface.UiBuilder.Draw -= Draw;
}
}
}

View File

@ -2,8 +2,8 @@
using System.Collections.Generic;
using Pal.Client.Database;
namespace Pal.Client.Floors
{
namespace Pal.Client.Floors;
/// <summary>
/// A <see cref="ClientLocation"/> loaded in memory, with certain extra attributes as needed.
/// </summary>
@ -52,4 +52,3 @@ namespace Pal.Client.Floors
return $"PersistentLocation(Position={Position}, Type={Type})";
}
}
}

View File

@ -4,8 +4,8 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Pal.Client.Database;
namespace Pal.Client.Floors.Tasks
{
namespace Pal.Client.Floors.Tasks;
internal abstract class DbTask<T>
where T : DbTask<T>
{
@ -38,4 +38,3 @@ namespace Pal.Client.Floors.Tasks
protected abstract void Run(PalClientContext dbContext, ILogger<T> logger);
}
}

View File

@ -7,8 +7,8 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Pal.Client.Database;
namespace Pal.Client.Floors.Tasks
{
namespace Pal.Client.Floors.Tasks;
internal sealed class LoadTerritory : DbTask<LoadTerritory>
{
private readonly Cleanup _cleanup;
@ -76,4 +76,3 @@ namespace Pal.Client.Floors.Tasks
};
}
}
}

View File

@ -5,8 +5,8 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Pal.Client.Database;
namespace Pal.Client.Floors.Tasks
{
namespace Pal.Client.Floors.Tasks;
internal sealed class MarkLocalSeen : DbTask<MarkLocalSeen>
{
private readonly MemoryTerritory _territory;
@ -34,4 +34,3 @@ namespace Pal.Client.Floors.Tasks
}
}
}
}

View File

@ -5,8 +5,8 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Pal.Client.Database;
namespace Pal.Client.Floors.Tasks
{
namespace Pal.Client.Floors.Tasks;
internal sealed class MarkRemoteSeen : DbTask<MarkRemoteSeen>
{
private readonly MemoryTerritory _territory;
@ -48,4 +48,3 @@ namespace Pal.Client.Floors.Tasks
}
}
}
}

View File

@ -6,8 +6,8 @@ using Microsoft.Extensions.Logging;
using Pal.Client.Database;
using Pal.Common;
namespace Pal.Client.Floors.Tasks
{
namespace Pal.Client.Floors.Tasks;
internal sealed class SaveNewLocations : DbTask<SaveNewLocations>
{
private readonly MemoryTerritory _territory;
@ -74,4 +74,3 @@ namespace Pal.Client.Floors.Tasks
};
}
}
}

View File

@ -2,8 +2,8 @@
using Dalamud.Game.ClientState.Conditions;
using Pal.Common;
namespace Pal.Client.Floors
{
namespace Pal.Client.Floors;
public sealed class TerritoryState
{
private readonly ClientState _clientState;
@ -33,4 +33,3 @@ namespace Pal.Client.Floors
FoundOnCurrentFloor,
PomanderOfSafetyUsed,
}
}

View File

@ -4,10 +4,9 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Pal.Client
{
namespace Pal.Client;
internal interface ILanguageChanged
{
void LanguageChanged();
}
}

View File

@ -1,13 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
namespace Pal.Client.Net
{
namespace Pal.Client.Net;
internal sealed class JwtClaims
{
[JsonPropertyName("nameid")]
@ -77,19 +75,3 @@ namespace Pal.Client.Net
public override void Write(Utf8JsonWriter writer, List<string> value, JsonSerializerOptions options) => throw new NotImplementedException();
}
public sealed class JwtDateConverter : JsonConverter<DateTimeOffset>
{
static readonly DateTimeOffset Zero = new(1970, 1, 1, 0, 0, 0, TimeSpan.Zero);
public override DateTimeOffset Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
if (reader.TokenType != JsonTokenType.Number)
throw new JsonException("bad token type");
return Zero.AddSeconds(reader.GetInt64());
}
public override void Write(Utf8JsonWriter writer, DateTimeOffset value, JsonSerializerOptions options) => throw new NotImplementedException();
}
}

View File

@ -0,0 +1,20 @@
using System;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace Pal.Client.Net;
public sealed class JwtDateConverter : JsonConverter<DateTimeOffset>
{
static readonly DateTimeOffset Zero = new(1970, 1, 1, 0, 0, 0, TimeSpan.Zero);
public override DateTimeOffset Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
if (reader.TokenType != JsonTokenType.Number)
throw new JsonException("bad token type");
return Zero.AddSeconds(reader.GetInt64());
}
public override void Write(Utf8JsonWriter writer, DateTimeOffset value, JsonSerializerOptions options) => throw new NotImplementedException();
}

View File

@ -12,8 +12,8 @@ using Pal.Client.Configuration;
using Pal.Client.Extensions;
using Pal.Client.Properties;
namespace Pal.Client.Net
{
namespace Pal.Client.Net;
internal partial class RemoteApi
{
private readonly SemaphoreSlim _connectLock = new(1, 1);
@ -229,4 +229,3 @@ namespace Pal.Client.Net
public bool IsValid => IsLoggedIn && !IsExpired;
}
}
}

View File

@ -3,8 +3,8 @@ using System.Threading;
using System.Threading.Tasks;
using Export;
namespace Pal.Client.Net
{
namespace Pal.Client.Net;
internal partial class RemoteApi
{
public async Task<(bool, ExportRoot)> DoExport(CancellationToken cancellationToken = default)
@ -20,4 +20,3 @@ namespace Pal.Client.Net
return (exportReply.Success, exportReply.Data);
}
}
}

View File

@ -8,8 +8,8 @@ using Pal.Client.Database;
using Pal.Client.Floors;
using Palace;
namespace Pal.Client.Net
{
namespace Pal.Client.Net;
internal partial class RemoteApi
{
public async Task<(bool, List<PersistentLocation>)> DownloadRemoteMarkers(ushort territoryId, CancellationToken cancellationToken = default)
@ -84,4 +84,3 @@ namespace Pal.Client.Net
return (statisticsReply.Success, statisticsReply.FloorStatistics.ToList());
}
}
}

View File

@ -5,8 +5,8 @@ using Dalamud.Logging;
using Grpc.Core;
using Microsoft.Extensions.Logging;
namespace Pal.Client.Net
{
namespace Pal.Client.Net;
internal partial class RemoteApi
{
private Metadata UnauthorizedHeaders() => new()
@ -55,4 +55,3 @@ namespace Pal.Client.Net
#endif
}
}
}

View File

@ -6,8 +6,8 @@ using Microsoft.Extensions.Logging;
using Pal.Client.Configuration;
using Pal.Client.DependencyInjection;
namespace Pal.Client.Net
{
namespace Pal.Client.Net;
internal sealed partial class RemoteApi : IDisposable
{
#if DEBUG
@ -49,4 +49,3 @@ namespace Pal.Client.Net
_channel = null;
}
}
}

View File

@ -21,8 +21,8 @@ using Pal.Client.DependencyInjection;
using Pal.Client.Properties;
using Pal.Client.Rendering;
namespace Pal.Client
{
namespace Pal.Client;
/// <summary>
/// With all DI logic elsewhere, this plugin shell really only takes care of a few things around events that
/// need to be sent to different receivers depending on priority or configuration .
@ -234,4 +234,3 @@ namespace Pal.Client
Error
}
}
}

View File

@ -1,9 +1,8 @@
namespace Pal.Client.Rendering
{
namespace Pal.Client.Rendering;
internal enum ELayer
{
TrapHoard,
RegularCoffers,
Test,
}
}

View File

@ -1,9 +1,8 @@
namespace Pal.Client.Rendering
{
namespace Pal.Client.Rendering;
public interface IRenderElement
{
bool IsValid { get; }
uint Color { get; set; }
}
}

View File

@ -3,8 +3,8 @@ using System.Numerics;
using Pal.Client.Configuration;
using Pal.Client.Floors;
namespace Pal.Client.Rendering
{
namespace Pal.Client.Rendering;
internal interface IRenderer
{
ERenderer GetConfigValue();
@ -17,4 +17,3 @@ namespace Pal.Client.Rendering
void DrawDebugItems(uint trapColor, uint hoardColor);
}
}

View File

@ -1,8 +1,8 @@
using System.Collections.Generic;
using Pal.Client.Floors;
namespace Pal.Client.Rendering
{
namespace Pal.Client.Rendering;
internal sealed class MarkerConfig
{
private static readonly MarkerConfig EmptyConfig = new();
@ -21,4 +21,3 @@ namespace Pal.Client.Rendering
public static MarkerConfig ForType(MemoryLocation.EType type) =>
MarkerConfigs.GetValueOrDefault(type, EmptyConfig);
}
}

View File

@ -6,8 +6,8 @@ using Microsoft.Extensions.Logging;
using Pal.Client.Configuration;
using Pal.Client.Floors;
namespace Pal.Client.Rendering
{
namespace Pal.Client.Rendering;
internal sealed class RenderAdapter : IRenderer, IDisposable
{
private readonly IServiceScopeFactory _serviceScopeFactory;
@ -75,4 +75,3 @@ namespace Pal.Client.Rendering
sr.DrawLayers();
}
}
}

View File

@ -1,8 +1,7 @@
namespace Pal.Client.Rendering
{
namespace Pal.Client.Rendering;
internal static class RenderData
{
public static readonly uint ColorInvisible = 0;
public static readonly long TestLayerTimeout = 10_000;
}
}

View File

@ -11,8 +11,8 @@ using Pal.Client.Configuration;
using Pal.Client.DependencyInjection;
using Pal.Client.Floors;
namespace Pal.Client.Rendering
{
namespace Pal.Client.Rendering;
/// <summary>
/// Simple renderer that only draws basic stuff.
///
@ -201,4 +201,3 @@ namespace Pal.Client.Rendering
public required bool Fill { get; init; }
}
}
}

View File

@ -15,8 +15,8 @@ using Pal.Client.Configuration;
using Pal.Client.DependencyInjection;
using Pal.Client.Floors;
namespace Pal.Client.Rendering
{
namespace Pal.Client.Rendering;
internal sealed class SplatoonRenderer : IRenderer, IDisposable
{
private const long OnTerritoryChange = -2;
@ -193,4 +193,3 @@ namespace Pal.Client.Rendering
}
}
}
}

View File

@ -2,8 +2,8 @@
using Dalamud.Logging;
using Microsoft.Extensions.Logging;
namespace Pal.Client.Scheduled
{
namespace Pal.Client.Scheduled;
internal interface IQueueOnFrameworkThread
{
internal interface IHandler
@ -37,4 +37,3 @@ namespace Pal.Client.Scheduled
}
}
}
}

View File

@ -4,8 +4,8 @@ using Pal.Client.DependencyInjection;
using Pal.Client.Floors;
using Pal.Client.Rendering;
namespace Pal.Client.Scheduled
{
namespace Pal.Client.Scheduled;
internal sealed class QueuedConfigUpdate : IQueueOnFrameworkThread
{
internal sealed class Handler : IQueueOnFrameworkThread.Handler<QueuedConfigUpdate>
@ -26,4 +26,3 @@ namespace Pal.Client.Scheduled
}
}
}
}

View File

@ -10,8 +10,8 @@ using Pal.Client.Properties;
using Pal.Client.Windows;
using Pal.Common;
namespace Pal.Client.Scheduled
{
namespace Pal.Client.Scheduled;
internal sealed class QueuedImport : IQueueOnFrameworkThread
{
private ExportRoot Export { get; }
@ -120,4 +120,3 @@ namespace Pal.Client.Scheduled
}
}
}
}

View File

@ -11,8 +11,8 @@ using Pal.Client.Floors.Tasks;
using Pal.Client.Net;
using Pal.Common;
namespace Pal.Client.Scheduled
{
namespace Pal.Client.Scheduled;
internal sealed class QueuedSyncResponse : IQueueOnFrameworkThread
{
public required SyncType Type { get; init; }
@ -158,4 +158,3 @@ namespace Pal.Client.Scheduled
Download,
MarkSeen,
}
}

View File

@ -7,8 +7,8 @@ using Pal.Client.Floors;
using Pal.Client.Windows;
using Pal.Common;
namespace Pal.Client.Scheduled
{
namespace Pal.Client.Scheduled;
internal sealed class QueuedUndoImport : IQueueOnFrameworkThread
{
public QueuedUndoImport(Guid exportId)
@ -39,4 +39,3 @@ namespace Pal.Client.Scheduled
}
}
}
}

View File

@ -8,8 +8,8 @@ using Pal.Client.Configuration;
using Pal.Client.Extensions;
using Pal.Client.Properties;
namespace Pal.Client.Windows
{
namespace Pal.Client.Windows;
internal sealed class AgreementWindow : Window, IDisposable, ILanguageChanged
{
private const string WindowId = "###PalPalaceAgreement";
@ -102,4 +102,3 @@ namespace Pal.Client.Windows
GenericHelpers.ShellStart("https://github.com/carvelli/PalPalace");
}
}
}

View File

@ -23,8 +23,8 @@ using Pal.Client.Properties;
using Pal.Client.Rendering;
using Pal.Client.Scheduled;
namespace Pal.Client.Windows
{
namespace Pal.Client.Windows;
internal sealed class ConfigWindow : Window, ILanguageChanged, IDisposable
{
private const string WindowId = "###PalPalaceConfig";
@ -576,4 +576,3 @@ namespace Pal.Client.Windows
}
}
}
}

View File

@ -8,8 +8,8 @@ using Pal.Client.Properties;
using Pal.Common;
using Palace;
namespace Pal.Client.Windows
{
namespace Pal.Client.Windows;
internal sealed class StatisticsWindow : Window, IDisposable, ILanguageChanged
{
private const string WindowId = "###PalacePalStats";
@ -123,4 +123,3 @@ namespace Pal.Client.Windows
}
}
}
}

View File

@ -1,8 +1,8 @@
using System.ComponentModel.DataAnnotations;
using System.Diagnostics.CodeAnalysis;
namespace Pal.Common
{
namespace Pal.Common;
[SuppressMessage("ReSharper", "UnusedMember.Global")]
[SuppressMessage("ReSharper", "InconsistentNaming")]
public enum ETerritoryType : ushort
@ -60,4 +60,3 @@ namespace Pal.Common
EurekaOrthos_81_90,
EurekaOrthos_91_100
}
}

View File

@ -1,8 +1,8 @@
using System.ComponentModel.DataAnnotations;
using System.Reflection;
namespace Pal.Common
{
namespace Pal.Common;
public static class EnumExtensions
{
public static int? GetOrder(this Enum e)
@ -13,4 +13,3 @@ namespace Pal.Common
return attribute?.Order;
}
}
}

View File

@ -4,10 +4,9 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Pal.Common
{
namespace Pal.Common;
public static class ExportConfig
{
public static int ExportVersion => 2;
}
}

View File

@ -1,7 +1,7 @@
using System.Numerics;
namespace Pal.Common
{
namespace Pal.Common;
public class PalaceMath
{
private static readonly Vector3 ScaleFactor = new(5);
@ -19,4 +19,3 @@ namespace Pal.Common
return HashCode.Combine((int)v.X, (int)v.Y, (int)v.Z);
}
}
}