bug 3639: generalizing how PassingInstruction values are offered and processed

Change-Id: If894f4f5250e927788bc90a5f382c149c539fd91
This commit is contained in:
Axel Uhl committed 2016-05-01 11:18:31 +02:00
1 parent 7f5d8ae024
commit bd0b929505
4 files changed
+69 -18

No files matched your search

@@ -15,19 +15,26 @@ public enum PassingInstruction {
None(1, 2),
Port(1),
Starboard(1),
Single_Unknown(1),
Gate(2),
Line(2),
Offset(2),
FixedBearing(1),
Single_Unknown(1);
FixedBearing(1);
/**
* Those values relevant for picking by a user when creating a waypoint; for example, this list
* does not include the {@link #None} or the {@link #Single_Unknown} literals. No guarantees
* made as to the ordering. The enum literals may change, be extended, have elements inserted or
* removed at any time!
*/
public static PassingInstruction[] relevantValues() {
PassingInstruction[] uiValues = new PassingInstruction[PassingInstruction.values().length - 1];
int i = 0;
for (PassingInstruction p : PassingInstruction.values()) {
if (p != PassingInstruction.None)
if (p != None && p != Single_Unknown) {
uiValues[i++] = p;
}
}
return uiValues;
}