Added leavePlace() for games where you are sometimes not in any "place" at
all. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3638 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -188,6 +188,23 @@ public class LocationDirector extends BasicDirector
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Issues a request to leave our current location.
|
||||
*
|
||||
* @return true if we were able to leave, false if we are in the
|
||||
* middle of moving somewhere and can't yet leave.
|
||||
*/
|
||||
public boolean leavePlace ()
|
||||
{
|
||||
if (_pendingPlaceId != -1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
_lservice.leavePlace(_ctx.getClient());
|
||||
didLeavePlace();
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* This can be called by cooperating directors that need to coopt the
|
||||
* moving process to extend it in some way or other. In such
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: LocationService.java,v 1.9 2004/08/27 02:12:33 mdb Exp $
|
||||
// $Id$
|
||||
//
|
||||
// Narya library - tools for developing networked games
|
||||
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
|
||||
@@ -57,4 +57,9 @@ public interface LocationService extends InvocationService
|
||||
* failure.
|
||||
*/
|
||||
public void moveTo (Client client, int placeId, MoveListener listener);
|
||||
|
||||
/**
|
||||
* Requests that we leave our current place and move to nowhere land.
|
||||
*/
|
||||
public void leavePlace (Client client);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user