This commit is contained in:
Liza 2023-08-23 08:09:05 +02:00
parent b6bd9707b7
commit 81d6f268ee
Signed by: liza
GPG Key ID: 7199F8D727D55F67
4 changed files with 41 additions and 35 deletions

View File

@ -22,8 +22,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DalamudPackager" Version="2.1.11"/>
<PackageReference Include="InfluxDB.Client" Version="4.13.0"/>
<PackageReference Include="DalamudPackager" Version="2.1.11" />
<PackageReference Include="InfluxDB.Client" Version="4.13.0" />
</ItemGroup>
<ItemGroup>
@ -58,10 +58,10 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ECommons\ECommons\ECommons.csproj"/>
<ProjectReference Include="..\ECommons\ECommons\ECommons.csproj" />
</ItemGroup>
<Target Name="RenameLatestZip" AfterTargets="PackagePlugin">
<Exec Command="rename $(OutDir)$(AssemblyName)\latest.zip $(AssemblyName)-$(Version).zip"/>
<Exec Command="rename $(OutDir)$(AssemblyName)\latest.zip $(AssemblyName)-$(Version).zip" />
</Target>
</Project>

View File

@ -0,0 +1,21 @@
using System.Collections;
using System.Collections.Generic;
using System.Linq;
namespace Influx.SubmarineTracker;
public sealed class FcSubmarines
{
private readonly object _delegate;
public FcSubmarines(object @delegate)
{
_delegate = @delegate;
Submarines = ((IEnumerable)_delegate.GetType().GetField("Submarines")!.GetValue(_delegate)!)
.Cast<object>()
.Select(x => new Submarine(x))
.ToList();
}
public List<Submarine> Submarines { get; }
}

View File

@ -0,0 +1,16 @@
namespace Influx.SubmarineTracker;
public sealed class Submarine
{
private readonly object _delegate;
public Submarine(object @delegate)
{
_delegate = @delegate;
Name = (string)_delegate.GetType().GetProperty("Name")!.GetValue(_delegate)!;
Level = (ushort)_delegate.GetType().GetProperty("Rank")!.GetValue(_delegate)!;
}
public string Name { get; set; }
public ushort Level { get; }
}

View File

@ -53,34 +53,3 @@ internal sealed class SubmarineTrackerIpc
return new Dictionary<Character, List<SubmarineStats>>();
}
}
public sealed class FcSubmarines
{
private readonly object _delegate;
public FcSubmarines(object @delegate)
{
_delegate = @delegate;
Submarines = ((IEnumerable)_delegate.GetType().GetField("Submarines")!.GetValue(_delegate)!)
.Cast<object>()
.Select(x => new Submarine(x))
.ToList();
}
public List<Submarine> Submarines { get; }
}
public sealed class Submarine
{
private readonly object _delegate;
public Submarine(object @delegate)
{
_delegate = @delegate;
Name = (string)_delegate.GetType().GetProperty("Name")!.GetValue(_delegate)!;
Level = (ushort)_delegate.GetType().GetProperty("Rank")!.GetValue(_delegate)!;
}
public string Name { get; set; }
public ushort Level { get; }
}