diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2020-01-21 14:08:24 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2020-01-21 14:08:24 +0100 |
commit | d96cbcff5251ec3d4a92e45e701af9195032c517 (patch) | |
tree | b4898b1387eb65a584de18f0350eec8705561e96 /core/src/ch/asynk/gdx | |
parent | 3a153fe86fcd3ae224b7c6ddba1780eeed89ec8a (diff) | |
download | gdx-boardgame-d96cbcff5251ec3d4a92e45e701af9195032c517.zip gdx-boardgame-d96cbcff5251ec3d4a92e45e701af9195032c517.tar.gz |
Orientation : add Orientation opposite()
Diffstat (limited to 'core/src/ch/asynk/gdx')
-rw-r--r-- | core/src/ch/asynk/gdx/boardgame/Orientation.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/src/ch/asynk/gdx/boardgame/Orientation.java b/core/src/ch/asynk/gdx/boardgame/Orientation.java index 677c979..e5c906b 100644 --- a/core/src/ch/asynk/gdx/boardgame/Orientation.java +++ b/core/src/ch/asynk/gdx/boardgame/Orientation.java @@ -62,6 +62,12 @@ public enum Orientation return (o.r == -1) ? o.right() : o; } + public Orientation opposite() + { + if (s <= NW.s) return fromS(this.s << 4); + return fromS(this.s >> 4); + } + public static Orientation fromS(int s) { if (s == E.s) return E; |