Include Predicted Level after next Voyage in submarine stats
This commit is contained in:
parent
5670ef060d
commit
520f7373e6
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0-windows</TargetFramework>
|
||||
<Version>0.3</Version>
|
||||
<Version>0.4</Version>
|
||||
<LangVersion>11.0</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||
|
@ -217,6 +217,7 @@ internal sealed class InfluxStatisticsClient : IDisposable
|
||||
.Tag("part_bridge", sub.Bridge)
|
||||
.Tag("build", sub.Build)
|
||||
.Field("level", sub.Level)
|
||||
.Field("predicted_level", sub.PredictedLevel)
|
||||
.Timestamp(date, WritePrecision.S));
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,6 @@
|
||||
namespace Influx.SubmarineTracker;
|
||||
using System;
|
||||
|
||||
namespace Influx.SubmarineTracker;
|
||||
|
||||
public sealed class Submarine
|
||||
{
|
||||
@ -7,9 +9,20 @@ public sealed class Submarine
|
||||
Name = (string)@delegate.GetType().GetProperty("Name")!.GetValue(@delegate)!;
|
||||
Level = (ushort)@delegate.GetType().GetProperty("Rank")!.GetValue(@delegate)!;
|
||||
Build = new Build(@delegate.GetType().GetProperty("Build")!.GetValue(@delegate)!);
|
||||
|
||||
try
|
||||
{
|
||||
(uint predictedLevel, double _) = ((uint, double))@delegate.GetType().GetMethod("PredictExpGrowth")!.Invoke(@delegate, Array.Empty<object?>())!;
|
||||
PredictedLevel = (ushort)predictedLevel;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
PredictedLevel = Level;
|
||||
}
|
||||
}
|
||||
|
||||
public string Name { get; }
|
||||
public ushort Level { get; }
|
||||
public ushort PredictedLevel { get; }
|
||||
public Build Build { get; }
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ public sealed class SubmarineStats
|
||||
public required string Name { get; init; }
|
||||
public required int Id { get; init; }
|
||||
public required ushort Level { get; init; }
|
||||
public required ushort PredictedLevel { get; init; }
|
||||
|
||||
public required string Hull { get; init; }
|
||||
public required string Stern { get; init; }
|
||||
|
@ -46,6 +46,7 @@ internal sealed class SubmarineTrackerIpc
|
||||
Id = x.Subs.IndexOf(y),
|
||||
Name = y.Name,
|
||||
Level = y.Level,
|
||||
PredictedLevel = y.PredictedLevel,
|
||||
Hull = y.Build.HullIdentifier,
|
||||
Stern = y.Build.SternIdentifier,
|
||||
Bow = y.Build.BowIdentifier,
|
||||
|
Loading…
Reference in New Issue
Block a user