enum HoldSide { SHORT, LONG; static HoldSide fromInt(int direction) { if (direction > 0) ret LONG; if (direction < 0) ret SHORT; fail("direction 0"); } }