From a54b3e279c38b6325216d3a654e101b0dd1a12bb Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Wed, 12 Feb 2003 07:22:04 +0000 Subject: [PATCH] Added getOpposite(). git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2273 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/java/com/threerings/util/DirectionUtil.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/java/com/threerings/util/DirectionUtil.java b/src/java/com/threerings/util/DirectionUtil.java index 8e9cd446e..563738249 100644 --- a/src/java/com/threerings/util/DirectionUtil.java +++ b/src/java/com/threerings/util/DirectionUtil.java @@ -1,5 +1,5 @@ // -// $Id: DirectionUtil.java,v 1.7 2002/07/02 23:15:53 shaper Exp $ +// $Id: DirectionUtil.java,v 1.8 2003/02/12 07:22:04 mdb Exp $ package com.threerings.util; @@ -107,6 +107,14 @@ public class DirectionUtil implements DirectionCodes return direction; } + /** + * Returns the opposite of the specified direction. + */ + public static int getOpposite (int direction) + { + return rotateCW(direction, FINE_CW_ROTATE.length/2); + } + /** * Returns which of the eight compass directions that point * b lies in from point a as one of the