extend SafeInterval

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1433 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2002-06-10 21:37:13 +00:00
parent 7a9946e0ad
commit 0443a31294
@@ -1,5 +1,5 @@
// //
// $Id: AIGameTicker.java,v 1.2 2002/04/19 21:33:21 ray Exp $ // $Id: AIGameTicker.java,v 1.3 2002/06/10 21:37:13 ray Exp $
package com.threerings.parlor.game; package com.threerings.parlor.game;
@@ -9,12 +9,13 @@ import java.util.HashSet;
import com.samskivert.util.Interval; import com.samskivert.util.Interval;
import com.samskivert.util.IntervalManager; import com.samskivert.util.IntervalManager;
import com.threerings.presents.server.util.SafeInterval;
import com.threerings.crowd.server.CrowdServer; import com.threerings.crowd.server.CrowdServer;
/** /**
* Handles ticking all the GameManagers that are hosting games with AIs. * Handles ticking all the GameManagers that are hosting games with AIs.
*/ */
public class AIGameTicker implements Interval, Runnable public class AIGameTicker extends SafeInterval
{ {
/** /**
* Register the specified GameManager to receive AI ticks. * Register the specified GameManager to receive AI ticks.
@@ -42,6 +43,7 @@ public class AIGameTicker implements Interval, Runnable
*/ */
private AIGameTicker () private AIGameTicker ()
{ {
super(CrowdServer.omgr);
_games = new HashSet(); _games = new HashSet();
_id = IntervalManager.register(this, TICK_FREQUENCY, null, true); _id = IntervalManager.register(this, TICK_FREQUENCY, null, true);
@@ -71,12 +73,6 @@ public class AIGameTicker implements Interval, Runnable
} }
} }
// documentation inherited from interface
public void intervalExpired (int id, Object arg)
{
CrowdServer.omgr.postUnit(this);
}
/** /**
* Tick all the game AIs while on the dobj thread. * Tick all the game AIs while on the dobj thread.
*/ */