From c3f418d1ac4006a258dab533896d5b0ed4b224ce Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Thu, 1 Sep 2005 21:52:19 +0000 Subject: [PATCH] Changed our frame participant to be a non-anynonmous class to support subclassing it in the SwordController. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3693 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../puzzle/client/PuzzleController.java | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/src/java/com/threerings/puzzle/client/PuzzleController.java b/src/java/com/threerings/puzzle/client/PuzzleController.java index 17ae484c3..551da445b 100644 --- a/src/java/com/threerings/puzzle/client/PuzzleController.java +++ b/src/java/com/threerings/puzzle/client/PuzzleController.java @@ -829,16 +829,15 @@ public abstract class PuzzleController extends GameController protected PuzzlePanel _panel; } - /** The mouse jockey for unpausing our puzzles. */ - protected Unpauser _unpauser; - - /** Handles the sending of puzzle progress updates. We can't just + /** A special frame participant that handles the sending of puzzle + * progress updates. We can't just * register an interval for this because sometimes the clock goes * backwards in time in windows and our intervals don't get called for * a long period of time which causes the server to think the client * is disconnected or cheating and resign them from the puzzle. God * bless you, Microsoft. */ - protected FrameParticipant _updater = new FrameParticipant() { + protected class Updater implements FrameParticipant + { public void tick (long tickStamp) { if (_astate == ACTION_CLEARED) { // remove ourselves as the action is now cleared; we can't @@ -862,8 +861,22 @@ public abstract class PuzzleController extends GameController return null; } - protected long _lastProgressTick; - }; + public long _lastProgressTick; + } + + /** + * Create the updater to be used in this puzzle. + */ + protected Updater createUpdater () + { + return new Updater(); + } + + /** The mouse jockey for unpausing our puzzles. */ + protected Unpauser _unpauser; + + /** Handles the sending of puzzle progress updates. */ + protected Updater _updater = createUpdater(); /** Listens for players being knocked out. */ protected ElementUpdateListener _kolist = new ElementUpdateListener() {