Skip to content

Commit

Permalink
Parse ship speed.
Browse files Browse the repository at this point in the history
  • Loading branch information
Arcitectus committed Apr 13, 2016
1 parent f2ad2ce commit 98b39db
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Binary file modified lib.intermediate/Sanderling.dll
Binary file not shown.
6 changes: 5 additions & 1 deletion src/Sanderling/Sanderling/Parse/ShipUi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ public partial class ShipUi : IShipUi

public IShipUiIndication Indication { private set; get; }

Int64? SpeedMilliParsed { set; get; }

ShipUi()
{
}
Expand All @@ -116,6 +118,8 @@ public ShipUi(MemoryStruct.IShipUi raw)
Raw = raw;

Indication = Raw?.Indication?.ParseAsShipUiIndication();

SpeedMilliParsed = Raw?.SpeedLabel?.Text?.RegexMatchIfSuccess("(" + Number.DefaultNumberFormatRegexPatternAllowLeadingAndTrailingChars + @")\s*m/s")?.Groups[1]?.Value?.NumberParseDecimalMilli();
}
}

Expand Down Expand Up @@ -157,7 +161,7 @@ public partial class ShipUi

public IUIElementText[] Readout => Raw?.Readout;

public long? SpeedMilli => Raw?.SpeedMilli;
public long? SpeedMilli => Raw?.SpeedMilli ?? SpeedMilliParsed;

public IShipUiTimer[] Timer => Raw?.Timer;
}
Expand Down

0 comments on commit 98b39db

Please sign in to comment.