From fb587d2190c1234d2dde6a366fd79b14b462f407 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Wed, 24 Oct 2001 00:38:01 +0000 Subject: [PATCH] PlaceManager now downcalls to let derived classes know when it becomes empty. Some derived classes will probably want to commit suicide at that point. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@539 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../threerings/crowd/server/PlaceManager.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/java/com/threerings/crowd/server/PlaceManager.java b/src/java/com/threerings/crowd/server/PlaceManager.java index 025fcaf41..1080e61b9 100644 --- a/src/java/com/threerings/crowd/server/PlaceManager.java +++ b/src/java/com/threerings/crowd/server/PlaceManager.java @@ -1,5 +1,5 @@ // -// $Id: PlaceManager.java,v 1.19 2001/10/12 19:30:44 mdb Exp $ +// $Id: PlaceManager.java,v 1.20 2001/10/24 00:38:01 mdb Exp $ package com.threerings.crowd.server; @@ -204,6 +204,21 @@ public class PlaceManager if (_plobj.occupantInfo.containsKey(key)) { _plobj.removeFromOccupantInfo(key); } + + // if that leaves us with zero occupants, maybe do something + if (_plobj.occupants.size() == 0) { + placeBecameEmpty(); + } + } + + /** + * Called when we transition from having bodies in the place to not + * having any bodies in the place. Some places may take this as a sign + * to pack it in, others may wish to stick around. In any case, they + * can override this method to do their thing. + */ + protected void placeBecameEmpty () + { } /**