From 0acbab87ef7d8d858ace9431d05ad61f7d6b7f38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Fri, 26 Sep 2014 14:58:18 +0200 Subject: Orientation: add int allBut(), oppositeSide() -> opposite() --- core/src/ch/asynk/tankontank/engine/Board.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/src/ch/asynk/tankontank/engine/Board.java b/core/src/ch/asynk/tankontank/engine/Board.java index 6bab3d0..6616b0b 100644 --- a/core/src/ch/asynk/tankontank/engine/Board.java +++ b/core/src/ch/asynk/tankontank/engine/Board.java @@ -28,6 +28,7 @@ public abstract class Board extends Image implements Disposable { public enum Orientation { + ALL(0, 63), KEEP(0, 0), NORTH(270, 1), NORTH_EAST(210, 2), @@ -62,11 +63,16 @@ public abstract class Board extends Image implements Disposable else return fromSide(s << 1); } - public Orientation oppositeSide() + public Orientation opposite() { return left().left().left(); } + public int allBut() + { + return ALL.s & (s ^ 0xFFFF); + } + public int getFrontSides() { return s | left().s | right().s; @@ -74,7 +80,7 @@ public abstract class Board extends Image implements Disposable public int getBackSides() { - return oppositeSide().getFrontSides(); + return opposite().getFrontSides(); } public static Orientation fromSide(int s) -- cgit v1.1-2-g2b99