diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/luxons/sevenwonders/game/cards/HandRotationDirection.java | 4 | ||||
-rw-r--r-- | src/test/java/org/luxons/sevenwonders/game/cards/HandRotationDirectionTest.java | 15 |
2 files changed, 17 insertions, 2 deletions
diff --git a/src/main/java/org/luxons/sevenwonders/game/cards/HandRotationDirection.java b/src/main/java/org/luxons/sevenwonders/game/cards/HandRotationDirection.java index 4d33a8db..9c4f4b02 100644 --- a/src/main/java/org/luxons/sevenwonders/game/cards/HandRotationDirection.java +++ b/src/main/java/org/luxons/sevenwonders/game/cards/HandRotationDirection.java @@ -14,7 +14,7 @@ public enum HandRotationDirection { } public static HandRotationDirection forAge(int age) { - // clockwise at age 1, and alternating - return age % 2 == 0 ? HandRotationDirection.LEFT : HandRotationDirection.RIGHT; + // clockwise (pass to the left) at age 1, and alternating + return age % 2 == 0 ? HandRotationDirection.RIGHT : HandRotationDirection.LEFT; } } diff --git a/src/test/java/org/luxons/sevenwonders/game/cards/HandRotationDirectionTest.java b/src/test/java/org/luxons/sevenwonders/game/cards/HandRotationDirectionTest.java new file mode 100644 index 00000000..6165d158 --- /dev/null +++ b/src/test/java/org/luxons/sevenwonders/game/cards/HandRotationDirectionTest.java @@ -0,0 +1,15 @@ +package org.luxons.sevenwonders.game.cards; + +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + +public class HandRotationDirectionTest { + + @Test + public void testAgesDirections() throws Exception { + assertEquals(HandRotationDirection.LEFT, HandRotationDirection.forAge(1)); + assertEquals(HandRotationDirection.RIGHT, HandRotationDirection.forAge(2)); + assertEquals(HandRotationDirection.LEFT, HandRotationDirection.forAge(3)); + } +}
\ No newline at end of file |