I\'m programming a game in java which is made up of a grid of tiles. I wan\'t to be able to inuitively define the edges of the tiles and how they relate to each other, e.g.
enum Edge { TOP { @Override public Edge opposite() { return BOTTOM; } }, BOTTOM { @Override public Edge opposite() { return TOP; } }, LEFT { @Override public Edge opposite() { return RIGHT; } }, RIGHT { @Override public Edge opposite() { return LEFT; } }; public abstract Edge opposite(); }