diff --git a/src/as/com/threerings/crowd/data/TokenRing.as b/src/as/com/threerings/crowd/data/TokenRing.as index 8c0bddb9a..f9f2239ff 100644 --- a/src/as/com/threerings/crowd/data/TokenRing.as +++ b/src/as/com/threerings/crowd/data/TokenRing.as @@ -74,11 +74,22 @@ public class TokenRing extends SimpleStreamableObject } /** - * Returns true if this token ring contains the specified token. + * Returns true if this token ring contains the specified token or tokens, + * exactly. + * For example, if you pass in the OR of two or more tokens, + * then the ring must contain all of those tokens. */ public function holdsToken (token :int) :Boolean { - return (_tokens & token) != 0; + return (_token & token) == token; + } + + /** + * Returns true if this token ring contains any one of the specified tokens. + */ + public function holdsAnyToken (tokens :int) :Boolean + { + return (_tokens & tokens) != 0; } /** diff --git a/src/java/com/threerings/crowd/data/TokenRing.java b/src/java/com/threerings/crowd/data/TokenRing.java index 824368e8e..67f764a1a 100644 --- a/src/java/com/threerings/crowd/data/TokenRing.java +++ b/src/java/com/threerings/crowd/data/TokenRing.java @@ -49,11 +49,22 @@ public class TokenRing extends SimpleStreamableObject } /** - * Returns true if this token ring contains the specified token. + * Returns true if this token ring contains the specified token or tokens, + * exactly. + * For example, if you pass in the OR of two or more tokens, + * then the ring must contain all of those tokens. */ public boolean holdsToken (int token) { - return (_tokens & token) != 0; + return (_tokens & token) == token; + } + + /** + * Returns true if this token ring contains any one of the specified tokens. + */ + public boolean holdsAnyToken (int tokens) + { + return (_tokens & tokens) != 0; } /**