Skip to content

Instantly share code, notes, and snippets.

@ft975
Created June 12, 2013 22:27
Show Gist options
  • Save ft975/5769682 to your computer and use it in GitHub Desktop.
Save ft975/5769682 to your computer and use it in GitHub Desktop.
public enum MachineSide {
FRONT, BACK, LEFT, RIGHT, TOP, BOTTOM;
public ForgeDirection toDirection(ForgeDirection facing) { //This method must return a result of type ForgeDirection. Note that a problem regarding missing 'default:' on 'switch' has been suppressed, which is perhaps related to this problem
switch (this) {
case BACK:
return facing.getOpposite();
case BOTTOM:
return ForgeDirection.DOWN;
case FRONT:
return facing;
case LEFT:
return facing.getRotation(ForgeDirection.WEST);
case RIGHT:
return facing.getRotation(ForgeDirection.EAST);
case TOP:
return ForgeDirection.UP;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment