forked from vatSys/AuroraLabelItemsPlugin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathExtensions.cs
44 lines (36 loc) · 1.14 KB
/
Extensions.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using AtopPlugin.Conflict;
using AtopPlugin.State;
using vatsys;
namespace AtopPlugin;
public static class Extensions
{
public static AtopAircraftState? GetAtopState(this FDP2.FDR fdr)
{
return AtopPluginStateManager.GetAircraftState(fdr.Callsign);
}
public static AtopAircraftDisplayState? GetDisplayState(this FDP2.FDR fdr)
{
return AtopPluginStateManager.GetDisplayState(fdr.Callsign);
}
public static ConflictProbe.Conflicts? GetConflicts(this FDP2.FDR fdr)
{
return AtopPluginStateManager.GetConflicts(fdr.Callsign);
}
public static int? GetTransponderCode(this FDP2.FDR fdr)
{
return fdr.CoupledTrack?.ActualAircraft.TransponderCode;
}
public static bool IsJet(this FDP2.FDR fdr)
{
return fdr.PerformanceData?.IsJet ?? false;
}
public static bool IsConnected(this FDP2.FDR fdr)
{
return fdr.CoupledTrack?.ActualAircraft != null ||
Network.GetOnlinePilots.Exists(pilot => pilot.Callsign == fdr.Callsign);
}
public static bool IsSelected(this Track track)
{
return MMI.SelectedTrack == track;
}
}