From 0a89eedc6c1b3d4ee0e71c68e72dbc453227223c Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Tue, 24 Oct 2006 22:16:57 +0000 Subject: [PATCH] Nixed JavaConstants. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4434 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/as/com/threerings/presents/net/UpstreamMessage.as | 4 ++-- src/as/com/threerings/util/JavaConstants.as | 7 ------- src/as/com/threerings/util/Short.as | 7 +++++++ 3 files changed, 9 insertions(+), 9 deletions(-) delete mode 100644 src/as/com/threerings/util/JavaConstants.as diff --git a/src/as/com/threerings/presents/net/UpstreamMessage.as b/src/as/com/threerings/presents/net/UpstreamMessage.as index 26d15b623..372bbf5fe 100644 --- a/src/as/com/threerings/presents/net/UpstreamMessage.as +++ b/src/as/com/threerings/presents/net/UpstreamMessage.as @@ -4,7 +4,7 @@ import com.threerings.io.Streamable; import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectOutputStream; -import com.threerings.util.JavaConstants; +import com.threerings.util.Short; public /* abstract */ class UpstreamMessage implements Streamable @@ -41,7 +41,7 @@ public /* abstract */ class UpstreamMessage */ protected static function nextMessageId () :int { - _nextMessageId = (_nextMessageId + 1) % JavaConstants.SHORT_MAX_VALUE; + _nextMessageId = (_nextMessageId + 1) % Short.MAX_VALUE; return _nextMessageId; } diff --git a/src/as/com/threerings/util/JavaConstants.as b/src/as/com/threerings/util/JavaConstants.as deleted file mode 100644 index bfa2de140..000000000 --- a/src/as/com/threerings/util/JavaConstants.as +++ /dev/null @@ -1,7 +0,0 @@ -package com.threerings.util { - -public class JavaConstants -{ - public static const SHORT_MAX_VALUE :int = (Math.pow(2, 15) - 1); -} -} diff --git a/src/as/com/threerings/util/Short.as b/src/as/com/threerings/util/Short.as index 70e87f7e4..98e23cd5f 100644 --- a/src/as/com/threerings/util/Short.as +++ b/src/as/com/threerings/util/Short.as @@ -6,6 +6,13 @@ package com.threerings.util { public class Short implements Equalable, Wrapped { + /** The minimum possible short value. */ + public static const MIN_VALUE :int = -Math.pow(2, 15); + + /** The maximum possible short value. */ + public static const MAX_VALUE :int = (Math.pow(2, 15) - 1); + + /** The value of this short. */ public var value :int; public static function valueOf (val :int) :Short