summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/gdx/boardgame/Orientation.java
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2020-01-22 22:12:08 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2020-01-22 22:12:08 +0100
commitb0641f54015894e6a78aa648d44c7c019d5559a0 (patch)
treef857eb57df26b6d7179dc71a1157fe2a4f1d4cdc /core/src/ch/asynk/gdx/boardgame/Orientation.java
parentfd3bd47424982c85f8b5c05110a1e639437bee8f (diff)
downloadgdx-boardgame-b0641f54015894e6a78aa648d44c7c019d5559a0.zip
gdx-boardgame-b0641f54015894e6a78aa648d44c7c019d5559a0.tar.gz
set units up, and reorder angles
Diffstat (limited to 'core/src/ch/asynk/gdx/boardgame/Orientation.java')
-rw-r--r--core/src/ch/asynk/gdx/boardgame/Orientation.java22
1 files changed, 13 insertions, 9 deletions
diff --git a/core/src/ch/asynk/gdx/boardgame/Orientation.java b/core/src/ch/asynk/gdx/boardgame/Orientation.java
index 166830a..8450dff 100644
--- a/core/src/ch/asynk/gdx/boardgame/Orientation.java
+++ b/core/src/ch/asynk/gdx/boardgame/Orientation.java
@@ -29,15 +29,19 @@ public enum Orientation
public static void setValues(int [] angles)
{
- DEFAULT.r = angles[0];
- E.r = angles[1];
- NE.r = angles[2];
- N.r = angles[3];
- NW.r = angles[4];
- W.r = angles[5];
- SW.r = angles[6];
- S.r = angles[7];
- SE.r = angles[8];
+ for (int i = 0; i < angles.length; i++) {
+ if (angles[i] < 0 && angles[i] != -1)
+ angles[i] += 360;
+ }
+ E.r = angles[0];
+ NE.r = angles[1];
+ N.r = angles[2];
+ NW.r = angles[3];
+ W.r = angles[4];
+ SW.r = angles[5];
+ S.r = angles[6];
+ SE.r = angles[7];
+ DEFAULT.r = angles[8];
}
public int allBut()