Added isLocationOccupied() which allows server-side entities to determine
definitively whether or not someone is in a location and/or has it reserved via a call to getUnoccupiedLocation(). git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1653 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: SpotSceneManager.java,v 1.16 2002/08/14 19:07:58 mdb Exp $
|
// $Id: SpotSceneManager.java,v 1.17 2002/08/20 18:21:45 mdb Exp $
|
||||||
|
|
||||||
package com.threerings.whirled.spot.server;
|
package com.threerings.whirled.spot.server;
|
||||||
|
|
||||||
@@ -69,11 +69,22 @@ public class SpotSceneManager extends SceneManager
|
|||||||
_sscene.getModel(), _locationOccs, preferClusters);
|
_sscene.getModel(), _locationOccs, preferClusters);
|
||||||
if (locId != -1) {
|
if (locId != -1) {
|
||||||
// mark the location as pending
|
// mark the location as pending
|
||||||
|
// Log.info("Earmarked location [scene=" + where() +
|
||||||
|
// ", locId=" + locId + "].");
|
||||||
_locationOccs[_sscene.getLocationIndex(locId)] = -1;
|
_locationOccs[_sscene.getLocationIndex(locId)] = -1;
|
||||||
}
|
}
|
||||||
return locId;
|
return locId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if the location in question is occupied by another
|
||||||
|
* body (or reserved for someone who's on their way).
|
||||||
|
*/
|
||||||
|
public boolean isLocationOccupied (int locId)
|
||||||
|
{
|
||||||
|
return (_locationOccs[_sscene.getLocationIndex(locId)] != 0);
|
||||||
|
}
|
||||||
|
|
||||||
// documentation inherited
|
// documentation inherited
|
||||||
protected void gotSceneData ()
|
protected void gotSceneData ()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user