From 923eaf3f7d61e64343f684cce06860393bc07a57 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Sat, 21 Jul 2007 01:14:06 +0000 Subject: [PATCH] Added getSceneId(Place). git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@373 c613c5cb-e716-0410-b11b-feb51c14d237 --- src/java/com/threerings/whirled/data/ScenePlace.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/java/com/threerings/whirled/data/ScenePlace.java b/src/java/com/threerings/whirled/data/ScenePlace.java index f375b221..2846de9a 100644 --- a/src/java/com/threerings/whirled/data/ScenePlace.java +++ b/src/java/com/threerings/whirled/data/ScenePlace.java @@ -32,12 +32,20 @@ public class ScenePlace extends Place /** The id of the scene occupied by the body. */ public int sceneId; + /** + * Returns the scene id for the supplied place or -1 if the place is null or not a scene place. + */ + public static int getSceneId (Place place) + { + return (place instanceof ScenePlace) ? ((ScenePlace)place).sceneId : -1; + } + /** * Returns the scene id occupied by the supplied body or -1 if the body is not in a scene. */ public static int getSceneId (BodyObject bobj) { - return (bobj.location instanceof ScenePlace) ? ((ScenePlace)bobj.location).sceneId : -1; + return getSceneId(bobj.location); } /** Used when unserializing. */