Cleanup
This commit is contained in:
parent
b6bd9707b7
commit
81d6f268ee
21
Influx/SubmarineTracker/FcSubmarines.cs
Normal file
21
Influx/SubmarineTracker/FcSubmarines.cs
Normal 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; }
|
||||
}
|
16
Influx/SubmarineTracker/Submarine.cs
Normal file
16
Influx/SubmarineTracker/Submarine.cs
Normal 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; }
|
||||
}
|
@ -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; }
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user