mirror of
https://github.com/gwdevhub/Daybreak.git
synced 2026-07-15 15:19:57 +00:00
Huge application refactoring to better support plugins (#960)
* Move shared code to Shared project * Move from Realm to Squealify * Rename Daybreak.Shared namespaces * Setup API project to expose a test API
This commit is contained in:
@@ -92,6 +92,11 @@ jobs:
|
||||
env:
|
||||
RuntimeIdentifier: win-${{ matrix.targetplatform }}
|
||||
|
||||
- name: Create publish API files
|
||||
run: dotnet publish .\Daybreak.API\Daybreak.API.csproj -c $env:Configuration -r $env:RuntimeIdentifier --property:SolutionDir=$env:GITHUB_WORKSPACE -p:PublishSingleFile=false --self-contained true -o .\Publish
|
||||
env:
|
||||
RuntimeIdentifier: win-${{ matrix.targetplatform }}
|
||||
|
||||
- name: Pack publish files
|
||||
run: |
|
||||
Write-Host $env
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
using Net.Sdk.Web;
|
||||
|
||||
namespace Daybreak.API.Controllers;
|
||||
|
||||
[GenerateController("api/test")]
|
||||
public sealed class TestController
|
||||
{
|
||||
[GenerateGet("testing")]
|
||||
public IResult GetTest(CancellationToken token)
|
||||
{
|
||||
return Results.Text("Hello from injected ASP-NET Core!", "text/plain");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0-windows</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<OutputType>Library</OutputType>
|
||||
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
|
||||
<StripSymbols>true</StripSymbols>
|
||||
<InteropExports>true</InteropExports>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
|
||||
<PublishAot>true</PublishAot>
|
||||
<SelfContained>true</SelfContained>
|
||||
|
||||
|
||||
<AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>
|
||||
<UseAppHost>false</UseAppHost>
|
||||
<EnableIISSupport>false</EnableIISSupport>
|
||||
<InvariantGlobalization>true</InvariantGlobalization>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Net.Sdk.Web.Extensions.SourceGenerators" Version="0.9.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Daybreak.Shared\Daybreak.Shared.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<DaybreakHostOutputDir>$(MSBuildProjectDirectory)\..\Daybreak\bin\x86\$(Configuration)\$(TargetFramework)\</DaybreakHostOutputDir>
|
||||
<ShouldPublishAot>true</ShouldPublishAot>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="PublishIntoDaybreak" AfterTargets="PostBuild" Condition="'$(ShouldPublishAot)'=='true'">
|
||||
<Message Text="📦 dotnet-publish Daybreak.API → $(DaybreakHostOutputDir)" Importance="High" />
|
||||
|
||||
<Exec Command="dotnet publish "$(MSBuildProjectFullPath)" -c $(Configuration) -r win-x86 --self-contained true -o "$(DaybreakHostOutputDir)"" WorkingDirectory="$(ProjectDir)" />
|
||||
</Target>
|
||||
</Project>
|
||||
@@ -0,0 +1,85 @@
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Runtime.InteropServices;
|
||||
using Daybreak.API.Extensions;
|
||||
using Daybreak.API.Serialization;
|
||||
using Net.Sdk.Web;
|
||||
|
||||
namespace Daybreak.API;
|
||||
|
||||
public static class EntryPoint
|
||||
{
|
||||
private const int StartPort = 5080;
|
||||
|
||||
[UnmanagedCallersOnly(EntryPoint = "ThreadInit"), STAThread]
|
||||
public static int ThreadInit(IntPtr _, int __)
|
||||
{
|
||||
ConsoleExtensions.AllocateAnsiConsole();
|
||||
var port = FindAvailablePort(StartPort);
|
||||
if (port <= 0)
|
||||
{
|
||||
Console.WriteLine($"No available port found starting from {StartPort}");
|
||||
return -1;
|
||||
}
|
||||
|
||||
Console.WriteLine($"Starting Daybreak API on port {port}");
|
||||
Task.Run(() => StartServer(port));
|
||||
return port;
|
||||
}
|
||||
|
||||
private static async Task StartServer(int port)
|
||||
{
|
||||
try
|
||||
{
|
||||
var builder = WebApplication.CreateBuilder();
|
||||
builder.WebHost.UseUrls($"http://127.0.0.1:{port}");
|
||||
builder.Services.ConfigureHttpJsonOptions(options =>
|
||||
{
|
||||
options.SerializerOptions.TypeInfoResolverChain.Insert(0, new ApiJsonSerializerContext());
|
||||
});
|
||||
builder.Logging.AddConsole();
|
||||
builder.WithRoutes();
|
||||
|
||||
var app = builder.Build();
|
||||
app.UseRoutes();
|
||||
|
||||
await app.RunAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.Error.WriteLine(ex);
|
||||
}
|
||||
}
|
||||
|
||||
private static int FindAvailablePort(int startPort)
|
||||
{
|
||||
var port = startPort;
|
||||
while (!IsPortAvailable(port))
|
||||
{
|
||||
port++;
|
||||
if (port > 65535 || port < 0)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return port;
|
||||
}
|
||||
|
||||
private static bool IsPortAvailable(int port)
|
||||
{
|
||||
var ipProperties = IPGlobalProperties.GetIPGlobalProperties();
|
||||
var tcpListeners = ipProperties.GetActiveTcpListeners();
|
||||
if (tcpListeners.Any(endpoint => endpoint.Port == port))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var tcpConnections = ipProperties.GetActiveTcpConnections();
|
||||
if (tcpConnections.Any(conn => conn.LocalEndPoint.Port == port))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
namespace Daybreak.API.Extensions;
|
||||
|
||||
public static class ConsoleExtensions
|
||||
{
|
||||
public static void AllocateAnsiConsole()
|
||||
{
|
||||
NativeMethods.AllocConsole();
|
||||
var handle = NativeMethods.GetStdHandle(NativeMethods.STD_OUTPUT_HANDLE);
|
||||
if (!NativeMethods.GetConsoleMode(handle, out var mode))
|
||||
{
|
||||
Console.WriteLine("Failed to get console mode");
|
||||
}
|
||||
|
||||
if (!NativeMethods.SetConsoleMode(handle, mode | NativeMethods.ENABLE_VIRTUAL_TERMINAL_PROCESSING | NativeMethods.ENABLE_PROCESSED_OUTPUT))
|
||||
{
|
||||
Console.WriteLine("Failed to enable virtual terminal processing");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Daybreak.API;
|
||||
|
||||
internal static partial class NativeMethods
|
||||
{
|
||||
public const int STD_OUTPUT_HANDLE = -11;
|
||||
public const uint ENABLE_VIRTUAL_TERMINAL_PROCESSING = 0x0004;
|
||||
public const uint ENABLE_PROCESSED_OUTPUT = 0x0001;
|
||||
|
||||
[LibraryImport("kernel32.dll", SetLastError = true)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
public static partial bool AllocConsole();
|
||||
|
||||
[LibraryImport("kernel32.dll", SetLastError = true)]
|
||||
public static partial nint GetConsoleWindow();
|
||||
|
||||
[LibraryImport("kernel32.dll", SetLastError = true)]
|
||||
public static partial nint GetStdHandle(int nStdHandle);
|
||||
|
||||
[LibraryImport("kernel32.dll")]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
public static partial bool GetConsoleMode(nint hConsoleHandle, out uint lpMode);
|
||||
|
||||
[LibraryImport("kernel32.dll")]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
public static partial bool SetConsoleMode(nint hConsoleHandle, uint dwMode);
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"profiles": {
|
||||
"Daybreak.API": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"applicationUrl": "https://localhost:51249;http://localhost:51250"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Daybreak.API.Serialization;
|
||||
|
||||
[JsonSerializable(typeof(string))]
|
||||
public partial class ApiJsonSerializerContext : JsonSerializerContext
|
||||
{
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
namespace Daybreak.Configuration.Options;
|
||||
namespace Daybreak.Shared.Configuration.Options;
|
||||
|
||||
public interface ITradeChatOptions
|
||||
{
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
|
||||
namespace Daybreak.Converters;
|
||||
namespace Daybreak.Shared.Converters;
|
||||
public sealed class AttributeJsonConverter : JsonConverter
|
||||
{
|
||||
public override bool CanConvert(Type objectType) => true;
|
||||
+1
-1
@@ -3,7 +3,7 @@ using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Media.Effects;
|
||||
|
||||
namespace Daybreak.Converters;
|
||||
namespace Daybreak.Shared.Converters;
|
||||
public sealed class BooleanToEffectConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
+1
-1
@@ -4,7 +4,7 @@ using System.Globalization;
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace Daybreak.Converters;
|
||||
namespace Daybreak.Shared.Converters;
|
||||
|
||||
public sealed class BooleanToGridLengthConverter : IValueConverter
|
||||
{
|
||||
+3
-3
@@ -4,7 +4,7 @@ using System.Globalization;
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace Daybreak.Converters;
|
||||
namespace Daybreak.Shared.Converters;
|
||||
|
||||
public class BooleanToVisibilityConverter : IValueConverter
|
||||
{
|
||||
@@ -38,12 +38,12 @@ public class BooleanToVisibilityConverter : IValueConverter
|
||||
}
|
||||
|
||||
var objValue = value.Cast<bool>();
|
||||
if ((objValue && this.TriggerValue && this.IsHidden) || (!objValue && !this.TriggerValue && this.IsHidden))
|
||||
if (objValue && this.TriggerValue && this.IsHidden || !objValue && !this.TriggerValue && this.IsHidden)
|
||||
{
|
||||
return Visibility.Hidden;
|
||||
}
|
||||
|
||||
if ((objValue && this.TriggerValue && !this.IsHidden) || (!objValue && !this.TriggerValue && !this.IsHidden))
|
||||
if (objValue && this.TriggerValue && !this.IsHidden || !objValue && !this.TriggerValue && !this.IsHidden)
|
||||
{
|
||||
return Visibility.Collapsed;
|
||||
}
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
using Daybreak.Models.Guildwars;
|
||||
using Daybreak.Shared.Models.Guildwars;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
|
||||
namespace Daybreak.Converters;
|
||||
namespace Daybreak.Shared.Converters;
|
||||
public sealed class CampaignJsonConverter : JsonConverter
|
||||
{
|
||||
public override bool CanConvert(Type objectType) => true;
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
using Daybreak.Models.Guildwars;
|
||||
using Daybreak.Shared.Models.Guildwars;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
|
||||
namespace Daybreak.Converters;
|
||||
namespace Daybreak.Shared.Converters;
|
||||
public sealed class ContinentJsonConverter : JsonConverter
|
||||
{
|
||||
public override bool CanConvert(Type objectType) => true;
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace Daybreak.Converters;
|
||||
namespace Daybreak.Shared.Converters;
|
||||
public sealed class DateTimeConverter : IValueConverter
|
||||
{
|
||||
public string? Format { get; set; }
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace Daybreak.Converters;
|
||||
namespace Daybreak.Shared.Converters;
|
||||
public sealed class DoubleMultiplierConverter : IValueConverter
|
||||
{
|
||||
public double Multiplier { get; set; }
|
||||
+1
-1
@@ -3,7 +3,7 @@ using System.Globalization;
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace Daybreak.Converters;
|
||||
namespace Daybreak.Shared.Converters;
|
||||
|
||||
public sealed class EqualityToVisibilityConverter : IMultiValueConverter
|
||||
{
|
||||
+5
-4
@@ -1,5 +1,6 @@
|
||||
using Daybreak.Models.Guildwars;
|
||||
using Daybreak.Services.Events;
|
||||
using Daybreak.Shared;
|
||||
using Daybreak.Shared.Models.Guildwars;
|
||||
using Daybreak.Shared.Services.Events;
|
||||
using ExCSS;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using System;
|
||||
@@ -11,11 +12,11 @@ using System.Windows.Data;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace Daybreak.Converters;
|
||||
namespace Daybreak.Shared.Converters;
|
||||
public sealed class EventCalendarDayToBrushConverter : IValueConverter
|
||||
{
|
||||
private readonly EventToBrushConverter eventToBrushConverter = new();
|
||||
private readonly IEventService eventService = Launch.Launcher.Instance.ApplicationServiceProvider.GetRequiredService<IEventService>();
|
||||
private readonly IEventService eventService = Global.GlobalServiceProvider.GetRequiredService<IEventService>();
|
||||
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
+5
-4
@@ -1,13 +1,14 @@
|
||||
using Daybreak.Models;
|
||||
using Daybreak.Models.Guildwars;
|
||||
using Daybreak.Shared.Models;
|
||||
using Daybreak.Shared.Models.Guildwars;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Media;
|
||||
using Brush = System.Windows.Media.Brush;
|
||||
|
||||
namespace Daybreak.Converters;
|
||||
internal sealed class EventToBrushConverter : IValueConverter
|
||||
namespace Daybreak.Shared.Converters;
|
||||
public sealed class EventToBrushConverter : IValueConverter
|
||||
{
|
||||
private static readonly Dictionary<Event, Brush> EventMapping = new()
|
||||
{
|
||||
+1
-1
@@ -3,7 +3,7 @@ using System.Globalization;
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace Daybreak.Converters;
|
||||
namespace Daybreak.Shared.Converters;
|
||||
|
||||
public class HiddenWhenNull : IValueConverter
|
||||
{
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace Daybreak.Converters;
|
||||
namespace Daybreak.Shared.Converters;
|
||||
|
||||
public sealed class IntToStringConverter : IValueConverter
|
||||
{
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace Daybreak.Converters;
|
||||
namespace Daybreak.Shared.Converters;
|
||||
|
||||
public class InverseBooleanConverter : IValueConverter
|
||||
{
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
using Daybreak.Models.Guildwars;
|
||||
using Daybreak.Shared.Models.Guildwars;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
|
||||
namespace Daybreak.Converters;
|
||||
namespace Daybreak.Shared.Converters;
|
||||
public sealed class ItemBaseJsonConverter : JsonConverter
|
||||
{
|
||||
public override bool CanConvert(Type objectType) => true;
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
using Daybreak.Models.Guildwars;
|
||||
using Daybreak.Shared.Models.Guildwars;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace Daybreak.Converters;
|
||||
namespace Daybreak.Shared.Converters;
|
||||
public sealed class ItemBaseToIntConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
using Daybreak.Models.Guildwars;
|
||||
using Daybreak.Shared.Models.Guildwars;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace Daybreak.Converters;
|
||||
namespace Daybreak.Shared.Converters;
|
||||
public sealed class ItemBaseToStringConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
using Daybreak.Models.Guildwars;
|
||||
using Daybreak.Shared.Models.Guildwars;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
|
||||
namespace Daybreak.Converters;
|
||||
namespace Daybreak.Shared.Converters;
|
||||
public sealed class MapJsonConverter : JsonConverter
|
||||
{
|
||||
public override bool CanConvert(Type objectType) => true;
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace Daybreak.Converters;
|
||||
namespace Daybreak.Shared.Converters;
|
||||
|
||||
public class MenuButtonHighlightConverter : IValueConverter
|
||||
{
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
using Daybreak.Models.Guildwars;
|
||||
using Daybreak.Shared.Models.Guildwars;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
namespace Daybreak.Converters;
|
||||
namespace Daybreak.Shared.Converters;
|
||||
public sealed class NpcJsonConverter : JsonConverter
|
||||
{
|
||||
public override bool CanConvert(Type objectType) => true;
|
||||
+9
-9
@@ -2,8 +2,8 @@
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace Daybreak.Converters;
|
||||
internal sealed class PriceToStringConverter : IValueConverter
|
||||
namespace Daybreak.Shared.Converters;
|
||||
public sealed class PriceToStringConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
@@ -14,13 +14,13 @@ internal sealed class PriceToStringConverter : IValueConverter
|
||||
|
||||
var price = value switch
|
||||
{
|
||||
byte byteVal => (double)byteVal,
|
||||
short shortVal => (double)shortVal,
|
||||
ushort ushortVal => (double)ushortVal,
|
||||
int intVal => (double)intVal,
|
||||
uint uintVal => (double)uintVal,
|
||||
long longVal => (double)longVal,
|
||||
ulong ulongVal => (double)ulongVal,
|
||||
byte byteVal => byteVal,
|
||||
short shortVal => shortVal,
|
||||
ushort ushortVal => ushortVal,
|
||||
int intVal => intVal,
|
||||
uint uintVal => uintVal,
|
||||
long longVal => longVal,
|
||||
ulong ulongVal => ulongVal,
|
||||
decimal decimalVal => (double)decimalVal,
|
||||
float floatVal => (double)floatVal,
|
||||
double doubleVal => (double)doubleVal,
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
using Daybreak.Models.Guildwars;
|
||||
using Daybreak.Shared.Models.Guildwars;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
|
||||
namespace Daybreak.Converters;
|
||||
namespace Daybreak.Shared.Converters;
|
||||
public sealed class ProfessionJsonConverter : JsonConverter
|
||||
{
|
||||
public override bool CanConvert(Type objectType) => true;
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
using Daybreak.Models.Guildwars;
|
||||
using Daybreak.Shared.Models.Guildwars;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
|
||||
namespace Daybreak.Converters;
|
||||
namespace Daybreak.Shared.Converters;
|
||||
public sealed class QuestJsonConverter : JsonConverter
|
||||
{
|
||||
public override bool CanConvert(Type objectType) => true;
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
using Daybreak.Models.Guildwars;
|
||||
using Daybreak.Shared.Models.Guildwars;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
|
||||
namespace Daybreak.Converters;
|
||||
namespace Daybreak.Shared.Converters;
|
||||
public sealed class RegionJsonConverter : JsonConverter
|
||||
{
|
||||
public override bool CanConvert(Type objectType) => true;
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
using Daybreak.Models.Guildwars;
|
||||
using Daybreak.Shared.Models.Guildwars;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
|
||||
namespace Daybreak.Converters;
|
||||
namespace Daybreak.Shared.Converters;
|
||||
public sealed class SkillJsonConverter : JsonConverter
|
||||
{
|
||||
public override bool CanConvert(Type objectType) => true;
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace Daybreak.Converters;
|
||||
namespace Daybreak.Shared.Converters;
|
||||
|
||||
public class TileButtonHighlightConverter : IValueConverter
|
||||
{
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace Daybreak.Converters;
|
||||
namespace Daybreak.Shared.Converters;
|
||||
|
||||
public sealed class TimeSinceDateTimeConverter : IValueConverter
|
||||
{
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace Daybreak.Converters;
|
||||
namespace Daybreak.Shared.Converters;
|
||||
|
||||
public sealed class TimespanToETAConverter : IValueConverter
|
||||
{
|
||||
@@ -30,6 +30,6 @@ public sealed class TimespanToETAConverter : IValueConverter
|
||||
return $"{(int)timeSpan.TotalDays} day{((int)timeSpan.TotalDays > 1 ? PluralAppend : string.Empty)} remaining";
|
||||
}
|
||||
|
||||
return $"{(int)timeSpan.Hours:D2}:{(int)timeSpan.Minutes:D2}:{(int)timeSpan.Seconds:D2} remaining";
|
||||
return $"{timeSpan.Hours:D2}:{timeSpan.Minutes:D2}:{timeSpan.Seconds:D2} remaining";
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
using Daybreak.Models.Guildwars;
|
||||
using Daybreak.Shared.Models.Guildwars;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
|
||||
namespace Daybreak.Converters;
|
||||
namespace Daybreak.Shared.Converters;
|
||||
public sealed class TitleJsonConverter : JsonConverter
|
||||
{
|
||||
public override bool CanConvert(Type objectType) => true;
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
using Daybreak.Models.Trade;
|
||||
using Daybreak.Shared.Models.Trade;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
|
||||
namespace Daybreak.Converters;
|
||||
namespace Daybreak.Shared.Converters;
|
||||
public sealed class TradeAlertConverter : JsonConverter<ITradeAlert>
|
||||
{
|
||||
public override ITradeAlert? ReadJson(JsonReader reader, Type objectType, ITradeAlert? existingValue, bool hasExistingValue, JsonSerializer serializer)
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
using Daybreak.Services.TradeChat.Models;
|
||||
using Daybreak.Shared.Models.Trade;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace Daybreak.Converters;
|
||||
namespace Daybreak.Shared.Converters;
|
||||
public sealed class TraderQuoteTypeToStringConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
@@ -0,0 +1,60 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0-windows</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<UseWPF>true</UseWPF>
|
||||
<LangVersion>preview</LangVersion>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AvalonEdit" Version="6.3.1.120" />
|
||||
<PackageReference Include="DiffPlex" Version="1.7.2" />
|
||||
<PackageReference Include="HtmlAgilityPack" Version="1.12.1" />
|
||||
<PackageReference Include="ini-parser-netstandard" Version="2.5.3" />
|
||||
<PackageReference Include="LiveChartsCore.SkiaSharpView.WPF" Version="2.0.0-rc2" />
|
||||
<PackageReference Include="MahApps.Metro" Version="2.4.10" />
|
||||
<PackageReference Include="Microsoft.CorrelationVector" Version="1.0.42" />
|
||||
<PackageReference Include="Microsoft.Data.Sqlite" Version="9.0.4" />
|
||||
<PackageReference Include="Microsoft.Data.Sqlite.Core" Version="9.0.4" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="9.0.4" />
|
||||
<PackageReference Include="Microsoft.Extensions.Http" Version="9.0.4" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.4" />
|
||||
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3240.44" />
|
||||
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.135" />
|
||||
<PackageReference Include="NAudio" Version="2.2.1" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="PeNet" Version="5.1.0" />
|
||||
<PackageReference Include="Plumsy" Version="1.1.0" />
|
||||
<PackageReference Include="securifybv.ShellLink" Version="0.1.0" />
|
||||
<PackageReference Include="Slim" Version="1.9.2" />
|
||||
<PackageReference Include="Squealify" Version="0.8.2.2" />
|
||||
<PackageReference Include="Svg" Version="3.4.7" />
|
||||
<PackageReference Include="System.Formats.Asn1" Version="9.0.4" />
|
||||
<PackageReference Include="System.IO.Compression" Version="4.3.0" />
|
||||
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
|
||||
<PackageReference Include="System.Net.Http" Version="4.3.4" />
|
||||
<PackageReference Include="System.Reflection.Metadata" Version="9.0.4" />
|
||||
<PackageReference Include="System.Text.Encoding.CodePages" Version="9.0.4" />
|
||||
<PackageReference Include="System.Text.Json" Version="9.0.4" />
|
||||
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
|
||||
<PackageReference Include="SystemExtensions.NetCore" Version="1.6.11" />
|
||||
<PackageReference Include="SystemExtensions.NetStandard" Version="1.6.11" />
|
||||
<PackageReference Include="SystemExtensions.NetStandard.DependencyInjection" Version="1.6.9" />
|
||||
<PackageReference Include="WpfExtended" Version="0.7.7" />
|
||||
<PackageReference Include="WpfExtended.SourceGeneration" Version="0.3.0" />
|
||||
<PackageReference Include="WpfScreenHelper" Version="2.1.1" />
|
||||
<PackageReference Include="WriteableBitmapEx" Version="1.6.8" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="RemoveDuplicateAnalyzers" BeforeTargets="CoreCompile">
|
||||
<!-- Work around https://github.com/dotnet/wpf/issues/6792 -->
|
||||
<ItemGroup>
|
||||
<FilteredAnalyzer Include="@(Analyzer->Distinct())" />
|
||||
<Analyzer Remove="@(Analyzer)" />
|
||||
<Analyzer Include="@(FilteredAnalyzer)" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
|
||||
namespace Daybreak.Exceptions;
|
||||
namespace Daybreak.Shared.Exceptions;
|
||||
|
||||
public sealed class CredentialsNotFoundException : Exception
|
||||
{
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
|
||||
namespace Daybreak.Exceptions;
|
||||
namespace Daybreak.Shared.Exceptions;
|
||||
|
||||
public sealed class ExecutableNotFoundException : Exception
|
||||
{
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
|
||||
namespace Daybreak.Exceptions;
|
||||
namespace Daybreak.Shared.Exceptions;
|
||||
|
||||
public sealed class FatalException : Exception
|
||||
{
|
||||
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
[assembly: InternalsVisibleTo("Daybreak")]
|
||||
|
||||
namespace Daybreak.Shared;
|
||||
|
||||
public static class Global
|
||||
{
|
||||
//Will get set by Daybreak on application startup
|
||||
public static IServiceProvider GlobalServiceProvider { get; internal set; } = default!;
|
||||
}
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Daybreak.Models;
|
||||
namespace Daybreak.Shared.Models;
|
||||
public readonly struct ApplicationLauncherContext
|
||||
{
|
||||
public string ExecutablePath { get; init; }
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace Daybreak.Services.Screenshots.Models;
|
||||
namespace Daybreak.Shared.Models;
|
||||
public sealed class BackgroundResponse
|
||||
{
|
||||
public ImageSource? ImageSource { get; set; }
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Collections.Specialized;
|
||||
|
||||
namespace Daybreak.Models;
|
||||
namespace Daybreak.Shared.Models;
|
||||
|
||||
public class BatchedObservableCollection<T> : ObservableCollection<T>
|
||||
{
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Daybreak.Models.Browser;
|
||||
namespace Daybreak.Shared.Models.Browser;
|
||||
public sealed class BrowserHistory
|
||||
{
|
||||
public List<string> History { get; set; } = [];
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace Daybreak.Models.Browser;
|
||||
namespace Daybreak.Shared.Models.Browser;
|
||||
|
||||
public class BrowserPayload
|
||||
{
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
namespace Daybreak.Models.Browser;
|
||||
namespace Daybreak.Shared.Models.Browser;
|
||||
|
||||
public sealed class DownloadPayload
|
||||
{
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Daybreak.Models.Browser;
|
||||
namespace Daybreak.Shared.Models.Browser;
|
||||
|
||||
public sealed class OnContextMenuPayload
|
||||
{
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
using Daybreak.Models.Builds;
|
||||
using Daybreak.Shared.Models.Builds;
|
||||
|
||||
namespace Daybreak.Models;
|
||||
namespace Daybreak.Shared.Models;
|
||||
|
||||
public sealed class BuildWithTemplateCode
|
||||
{
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
using System.ComponentModel;
|
||||
using Daybreak.Models.Guildwars;
|
||||
using Attribute = Daybreak.Shared.Models.Guildwars.Attribute;
|
||||
|
||||
namespace Daybreak.Models.Builds;
|
||||
namespace Daybreak.Shared.Models.Builds;
|
||||
|
||||
public sealed class AttributeEntry : INotifyPropertyChanged
|
||||
{
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Daybreak.Models.Builds;
|
||||
namespace Daybreak.Shared.Models.Builds;
|
||||
public interface IBuildEntry
|
||||
{
|
||||
public DateTimeOffset CreationTime { get; set; }
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
using Daybreak.Models.Guildwars;
|
||||
using Daybreak.Shared.Models.Guildwars;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using Attribute = Daybreak.Models.Guildwars.Attribute;
|
||||
using Attribute = Daybreak.Shared.Models.Guildwars.Attribute;
|
||||
|
||||
namespace Daybreak.Models.Builds;
|
||||
namespace Daybreak.Shared.Models.Builds;
|
||||
public sealed class SingleBuildEntry : BuildEntryBase, IBuildEntry, INotifyPropertyChanged, IEquatable<SingleBuildEntry>
|
||||
{
|
||||
public Profession Primary
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
using Daybreak.Models.Guildwars;
|
||||
using Daybreak.Shared.Models.Guildwars;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Daybreak.Models.Builds;
|
||||
namespace Daybreak.Shared.Models.Builds;
|
||||
public sealed class TeamBuildEntry : BuildEntryBase, IEquatable<TeamBuildEntry>
|
||||
{
|
||||
public List<SingleBuildEntry> Builds
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace Daybreak.Models;
|
||||
namespace Daybreak.Shared.Models;
|
||||
public static class ColorPalette
|
||||
{
|
||||
public readonly static Color Red = Color.FromArgb(255, 213, 0, 0);
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Daybreak.Models;
|
||||
namespace Daybreak.Shared.Models;
|
||||
|
||||
public enum ColorScheme
|
||||
{
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace Daybreak.Models;
|
||||
namespace Daybreak.Shared.Models;
|
||||
|
||||
public sealed class ColoredTextElement
|
||||
{
|
||||
@@ -1,6 +1,6 @@
|
||||
using Daybreak.Models.Builds;
|
||||
using Daybreak.Shared.Models.Builds;
|
||||
|
||||
namespace Daybreak.Models;
|
||||
namespace Daybreak.Shared.Models;
|
||||
public sealed class DownloadedBuild
|
||||
{
|
||||
public string? PreferredName { get; set; }
|
||||
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
|
||||
namespace Daybreak.Models;
|
||||
namespace Daybreak.Shared.Models;
|
||||
|
||||
public sealed class ElevationRequest
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
using Daybreak.Models.Guildwars;
|
||||
using Daybreak.Shared.Models.Guildwars;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Extensions;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Daybreak.Models;
|
||||
namespace Daybreak.Shared.Models;
|
||||
|
||||
public sealed class ExecutablePath : INotifyPropertyChanged
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Daybreak.Models;
|
||||
namespace Daybreak.Shared.Models;
|
||||
|
||||
public enum ExecutionPolicies
|
||||
{
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
using Daybreak.Models.Guildwars;
|
||||
using Daybreak.Models.LaunchConfigurations;
|
||||
using Daybreak.Shared.Models.Guildwars;
|
||||
using Daybreak.Shared.Models.LaunchConfigurations;
|
||||
|
||||
namespace Daybreak.Models.FocusView;
|
||||
namespace Daybreak.Shared.Models.FocusView;
|
||||
/// <summary>
|
||||
/// XD Name
|
||||
/// </summary>
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
using Daybreak.Models.Guildwars;
|
||||
using Daybreak.Shared.Models.Guildwars;
|
||||
|
||||
namespace Daybreak.Models.FocusView;
|
||||
namespace Daybreak.Shared.Models.FocusView;
|
||||
|
||||
public sealed class QuestEntry : QuestLogEntry
|
||||
{
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
using Daybreak.Models.Guildwars;
|
||||
using Daybreak.Shared.Models.Guildwars;
|
||||
|
||||
namespace Daybreak.Models.FocusView;
|
||||
namespace Daybreak.Shared.Models.FocusView;
|
||||
public sealed class QuestLocationEntry : QuestLogEntry
|
||||
{
|
||||
public override string Title { get; init; } = string.Empty;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
namespace Daybreak.Models.FocusView;
|
||||
namespace Daybreak.Shared.Models.FocusView;
|
||||
|
||||
public abstract class QuestLogEntry
|
||||
{
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
namespace Daybreak.Models.FocusView;
|
||||
namespace Daybreak.Shared.Models.FocusView;
|
||||
public sealed class QuestLogSeparator : QuestLogEntry
|
||||
{
|
||||
public override string Title { get; init; } = string.Empty;
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Daybreak.Models.Github;
|
||||
namespace Daybreak.Shared.Models.Github;
|
||||
|
||||
public sealed class GithubRefTag
|
||||
{
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
using Daybreak.Models.Progress;
|
||||
using Daybreak.Shared.Models.Progress;
|
||||
using System.Threading;
|
||||
|
||||
namespace Daybreak.Services.Guildwars.Models;
|
||||
namespace Daybreak.Shared.Models;
|
||||
public sealed class GuildWarsUpdateRequest
|
||||
{
|
||||
public string? ExecutablePath { get; init; }
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
namespace Daybreak.Services.Guildwars.Models;
|
||||
namespace Daybreak.Shared.Models;
|
||||
public sealed class GuildWarsUpdateResponse
|
||||
{
|
||||
public bool Result { get; init; }
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
using Daybreak.Converters;
|
||||
using Daybreak.Shared.Converters;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Daybreak.Models.Guildwars;
|
||||
namespace Daybreak.Shared.Models.Guildwars;
|
||||
|
||||
[JsonConverter(typeof(AttributeJsonConverter))]
|
||||
public sealed class Attribute
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using Daybreak.Models.Builds;
|
||||
using Daybreak.Shared.Models.Builds;
|
||||
|
||||
namespace Daybreak.Models.Guildwars;
|
||||
namespace Daybreak.Shared.Models.Guildwars;
|
||||
|
||||
public sealed class Build
|
||||
{
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
using Daybreak.Models.Builds;
|
||||
using Daybreak.Shared.Models.Builds;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Daybreak.Models.Guildwars;
|
||||
namespace Daybreak.Shared.Models.Guildwars;
|
||||
|
||||
public abstract class BuildEntryBase : INotifyPropertyChanged, IBuildEntry
|
||||
{
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Daybreak.Models.Guildwars;
|
||||
namespace Daybreak.Shared.Models.Guildwars;
|
||||
|
||||
public sealed class BuildMetadata
|
||||
{
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
using Daybreak.Converters;
|
||||
using Daybreak.Shared.Converters;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Daybreak.Models.Guildwars;
|
||||
namespace Daybreak.Shared.Models.Guildwars;
|
||||
|
||||
[JsonConverter(typeof(CampaignJsonConverter))]
|
||||
public sealed class Campaign
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
using Daybreak.Converters;
|
||||
using Daybreak.Shared.Converters;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Daybreak.Models.Guildwars;
|
||||
namespace Daybreak.Shared.Models.Guildwars;
|
||||
|
||||
[JsonConverter(typeof(ContinentJsonConverter))]
|
||||
public sealed class Continent
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Daybreak.Models.Guildwars;
|
||||
namespace Daybreak.Shared.Models.Guildwars;
|
||||
|
||||
/// <summary>
|
||||
/// Seasonal holidays and in-game events, as retrieved from https://www.guildwars.com/en/events.
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Daybreak.Models.Guildwars;
|
||||
namespace Daybreak.Shared.Models.Guildwars;
|
||||
public sealed class Hero : IWikiEntity
|
||||
{
|
||||
public static readonly Hero None = new() { Id = 0, Profession = Profession.None };
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
namespace Daybreak.Models.Guildwars;
|
||||
namespace Daybreak.Shared.Models.Guildwars;
|
||||
|
||||
public interface IIconUrlEntity
|
||||
{
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
namespace Daybreak.Models.Guildwars;
|
||||
namespace Daybreak.Shared.Models.Guildwars;
|
||||
|
||||
public interface IItemModHash
|
||||
{
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
namespace Daybreak.Models.Guildwars;
|
||||
namespace Daybreak.Shared.Models.Guildwars;
|
||||
|
||||
public interface IWikiEntity
|
||||
{
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Daybreak.Models.Guildwars;
|
||||
namespace Daybreak.Shared.Models.Guildwars;
|
||||
|
||||
public sealed class Inscription : ItemBase, IWikiEntity, IIconUrlEntity
|
||||
{
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
namespace Daybreak.Models.Guildwars;
|
||||
namespace Daybreak.Shared.Models.Guildwars;
|
||||
|
||||
public enum InstanceType
|
||||
{
|
||||
+3
-2
@@ -1,10 +1,10 @@
|
||||
using Daybreak.Converters;
|
||||
using Daybreak.Shared.Converters;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Daybreak.Models.Guildwars;
|
||||
namespace Daybreak.Shared.Models.Guildwars;
|
||||
|
||||
[JsonConverter(typeof(ItemBaseJsonConverter))]
|
||||
public abstract class ItemBase
|
||||
@@ -14,6 +14,7 @@ public abstract class ItemBase
|
||||
.Concat(Material.All)
|
||||
.Concat(Inscription.Inscriptions)
|
||||
.Concat(Rune.Runes)
|
||||
.Concat(VialOfDye.Vials)
|
||||
.ToList();
|
||||
|
||||
public static bool TryParse<T>(int id, IEnumerable<ItemModifier>? modifiers, out T item)
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
namespace Daybreak.Models.Guildwars;
|
||||
namespace Daybreak.Shared.Models.Guildwars;
|
||||
public readonly struct ItemModifier
|
||||
{
|
||||
public uint Modifier { get; init; }
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
namespace Daybreak.Models.Guildwars;
|
||||
namespace Daybreak.Shared.Models.Guildwars;
|
||||
|
||||
public sealed class LoginData
|
||||
{
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
namespace Daybreak.Models.Guildwars;
|
||||
namespace Daybreak.Shared.Models.Guildwars;
|
||||
|
||||
public sealed class MainPlayerData
|
||||
{
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Daybreak.Models.Guildwars;
|
||||
namespace Daybreak.Shared.Models.Guildwars;
|
||||
|
||||
public sealed class MainPlayerInformation
|
||||
{
|
||||
@@ -1,10 +1,10 @@
|
||||
using Daybreak.Converters;
|
||||
using Daybreak.Shared.Converters;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Daybreak.Models.Guildwars;
|
||||
namespace Daybreak.Shared.Models.Guildwars;
|
||||
|
||||
[JsonConverter(typeof(MapJsonConverter))]
|
||||
public sealed class Map : IWikiEntity
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Daybreak.Models.Guildwars;
|
||||
namespace Daybreak.Shared.Models.Guildwars;
|
||||
|
||||
public sealed class Material : ItemBase, IWikiEntity
|
||||
{
|
||||
@@ -1,10 +1,10 @@
|
||||
using Daybreak.Converters;
|
||||
using Daybreak.Shared.Converters;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Daybreak.Models.Guildwars;
|
||||
namespace Daybreak.Shared.Models.Guildwars;
|
||||
|
||||
// TODO: Add missing npcs
|
||||
[JsonConverter(typeof(NpcJsonConverter))]
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace Daybreak.Models.Guildwars;
|
||||
namespace Daybreak.Shared.Models.Guildwars;
|
||||
|
||||
public sealed class PartyCompositionMetadataEntry
|
||||
{
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Daybreak.Models.Guildwars;
|
||||
namespace Daybreak.Shared.Models.Guildwars;
|
||||
|
||||
public sealed class PlayerInformation
|
||||
{
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
|
||||
namespace Daybreak.Models.Guildwars;
|
||||
namespace Daybreak.Shared.Models.Guildwars;
|
||||
|
||||
public readonly struct Position : IEquatable<Position>
|
||||
{
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
using Daybreak.Converters;
|
||||
using Daybreak.Shared.Converters;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Daybreak.Models.Guildwars;
|
||||
namespace Daybreak.Shared.Models.Guildwars;
|
||||
|
||||
[JsonConverter(typeof(ProfessionJsonConverter))]
|
||||
public sealed class Profession : IWikiEntity
|
||||
@@ -1,10 +1,10 @@
|
||||
using Daybreak.Converters;
|
||||
using Daybreak.Shared.Converters;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Daybreak.Models.Guildwars;
|
||||
namespace Daybreak.Shared.Models.Guildwars;
|
||||
|
||||
[JsonConverter(typeof(QuestJsonConverter))]
|
||||
public sealed class Quest : IWikiEntity
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
namespace Daybreak.Models.Guildwars;
|
||||
namespace Daybreak.Shared.Models.Guildwars;
|
||||
|
||||
public sealed class QuestMetadata
|
||||
{
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user