From 882dc381b092fcfbdaa888fb02237c5e808aba79 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Wed, 24 Oct 2001 03:10:30 +0000 Subject: [PATCH] Added moveBack() which requests to move to the location we occupied immediately previous to our current location. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@551 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../crowd/client/LocationDirector.java | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/java/com/threerings/crowd/client/LocationDirector.java b/src/java/com/threerings/crowd/client/LocationDirector.java index d5e70969f..30e73f405 100644 --- a/src/java/com/threerings/crowd/client/LocationDirector.java +++ b/src/java/com/threerings/crowd/client/LocationDirector.java @@ -1,5 +1,5 @@ // -// $Id: LocationDirector.java,v 1.13 2001/10/18 01:40:04 mdb Exp $ +// $Id: LocationDirector.java,v 1.14 2001/10/24 03:10:30 mdb Exp $ package com.threerings.crowd.client; @@ -92,6 +92,24 @@ public class LocationDirector LocationService.moveTo(_ctx.getClient(), placeId, this); } + /** + * Requests to move to the room that we last occupied, if such a room + * exists. + * + * @return true if we had a previous room and we requested to move to + * it, false if we had no previous room. + */ + public boolean moveBack () + { + if (_previousPlaceId == -1) { + return false; + + } else { + moveTo(_previousPlaceId); + return true; + } + } + /** * This can be called by derived classes that need to coopt the moving * process to extend it in some way or other. In such situations, they