
com.github.phisgr.dds.Direction Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dds4j Show documentation
Show all versions of dds4j Show documentation
Wrapper around the Double Dummy Solver C++ Library.
The newest version!
package com.github.phisgr.dds;
public final class Direction extends Seats {
Direction(int encoded, String shortName) {
super(encoded, shortName);
}
public static Direction fromChar(char c) {
return switch (c) {
case 'N' -> Direction.N;
case 'E' -> Direction.E;
case 'S' -> Direction.S;
case 'W' -> Direction.W;
default -> throw new IllegalStateException("Unexpected value: " + c);
};
}
public static Direction fromInt(int i) {
return DIRECTIONS.get(i);
}
public Direction next() {
return DIRECTIONS.get((getEncoded() + 1) % 4);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy