Nix unneeded imports, add @Overrides, remove content-free comments, and rerun code generators.

git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@670 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
Dave Hoover
2008-07-18 19:02:08 +00:00
parent f30cb74ace
commit 624daadcd9
171 changed files with 371 additions and 459 deletions
@@ -119,6 +119,7 @@ public class ChatPanel extends JPanel
// listen to ancestor events to request focus when added // listen to ancestor events to request focus when added
addAncestorListener(new AncestorAdapter() { addAncestorListener(new AncestorAdapter() {
@Override
public void ancestorAdded (AncestorEvent e) { public void ancestorAdded (AncestorEvent e) {
if (_focus) { if (_focus) {
_entry.requestFocusInWindow(); _entry.requestFocusInWindow();
@@ -308,7 +309,7 @@ public class ChatPanel extends JPanel
// nothing doing // nothing doing
} }
// documentation inherited @Override
public Dimension getPreferredSize () public Dimension getPreferredSize ()
{ {
Dimension size = super.getPreferredSize(); Dimension size = super.getPreferredSize();
@@ -58,7 +58,7 @@ public class ClientController extends Controller
_frame.setPanel(_logonPanel); _frame.setPanel(_logonPanel);
} }
// documentation inherited @Override
public boolean handleAction (ActionEvent action) public boolean handleAction (ActionEvent action)
{ {
String cmd = action.getActionCommand(); String cmd = action.getActionCommand();
@@ -65,6 +65,7 @@ public class LogonPanel extends JPanel
JPanel box = new JPanel( JPanel box = new JPanel(
new VGroupLayout(VGroupLayout.NONE, VGroupLayout.STRETCH, new VGroupLayout(VGroupLayout.NONE, VGroupLayout.STRETCH,
5, VGroupLayout.CENTER)) { 5, VGroupLayout.CENTER)) {
@Override
public Dimension getPreferredSize () { public Dimension getPreferredSize () {
Dimension psize = super.getPreferredSize(); Dimension psize = super.getPreferredSize();
psize.width = Math.max(psize.width, 300); psize.width = Math.max(psize.width, 300);
@@ -118,6 +119,7 @@ public class LogonPanel extends JPanel
box.add(new JLabel(_msgs.get("m.status"))); box.add(new JLabel(_msgs.get("m.status")));
_status = new JTextArea() { _status = new JTextArea() {
@Override
public Dimension getPreferredScrollableViewportSize () public Dimension getPreferredScrollableViewportSize ()
{ {
return new Dimension(10, 100); return new Dimension(10, 100);
@@ -42,6 +42,7 @@ public class MiCasaApplet extends Applet
/** /**
* Create the client instance and set things up. * Create the client instance and set things up.
*/ */
@Override
public void init () public void init ()
{ {
try { try {
@@ -67,6 +68,7 @@ public class MiCasaApplet extends Applet
// we want to hide the client frame when we logoff // we want to hide the client frame when we logoff
client.addClientObserver(new ClientAdapter() { client.addClientObserver(new ClientAdapter() {
@Override
public void clientDidLogoff (Client c) public void clientDidLogoff (Client c)
{ {
_frame.setVisible(false); _frame.setVisible(false);
@@ -91,6 +93,7 @@ public class MiCasaApplet extends Applet
/** /**
* Display the client frame and really get things going. * Display the client frame and really get things going.
*/ */
@Override
public void start () public void start ()
{ {
if (_client != null) { if (_client != null) {
@@ -106,6 +109,7 @@ public class MiCasaApplet extends Applet
/** /**
* Log off and shut on down. * Log off and shut on down.
*/ */
@Override
public void stop () public void stop ()
{ {
if (_client != null) { if (_client != null) {
@@ -74,6 +74,7 @@ public class MiCasaClient
// log off when they close the window // log off when they close the window
_frame.addWindowListener(new WindowAdapter() { _frame.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing (WindowEvent evt) { public void windowClosing (WindowEvent evt) {
// if we're logged on, log off // if we're logged on, log off
if (_client.isLoggedOn()) { if (_client.isLoggedOn()) {
@@ -34,13 +34,13 @@ import com.threerings.parlor.game.data.GameConfig;
public class LobbyConfig extends PlaceConfig public class LobbyConfig extends PlaceConfig
{ {
// documentation inherited @Override
public PlaceController createController () public PlaceController createController ()
{ {
return new LobbyController(); return new LobbyController();
} }
// documentation inherited @Override
public String getManagerClassName () public String getManagerClassName ()
{ {
return "com.threerings.micasa.lobby.LobbyManager"; return "com.threerings.micasa.lobby.LobbyManager";
@@ -79,7 +79,7 @@ public class LobbyConfig extends PlaceConfig
_gameConfigClass = getConfigValue(config, "game_config"); _gameConfigClass = getConfigValue(config, "game_config");
} }
// documentation inherited @Override
protected void toString (StringBuilder buf) protected void toString (StringBuilder buf)
{ {
super.toString(buf); super.toString(buf);
@@ -39,6 +39,7 @@ import static com.threerings.micasa.Log.log;
public class LobbyController extends PlaceController public class LobbyController extends PlaceController
implements InvitationHandler, InvitationResponseObserver implements InvitationHandler, InvitationResponseObserver
{ {
@Override
public void init (CrowdContext ctx, PlaceConfig config) public void init (CrowdContext ctx, PlaceConfig config)
{ {
// cast our context reference // cast our context reference
@@ -51,12 +52,13 @@ public class LobbyController extends PlaceController
_ctx.getParlorDirector().setInvitationHandler(this); _ctx.getParlorDirector().setInvitationHandler(this);
} }
@Override
protected PlaceView createPlaceView (CrowdContext ctx) protected PlaceView createPlaceView (CrowdContext ctx)
{ {
return new LobbyPanel(_ctx, _config); return new LobbyPanel(_ctx, _config);
} }
// documentation inherited @Override
public void willEnterPlace (PlaceObject plobj) public void willEnterPlace (PlaceObject plobj)
{ {
super.willEnterPlace(plobj); super.willEnterPlace(plobj);
@@ -22,7 +22,6 @@
package com.threerings.micasa.lobby; package com.threerings.micasa.lobby;
import com.threerings.presents.data.ClientObject; import com.threerings.presents.data.ClientObject;
import com.threerings.presents.data.InvocationMarshaller;
import com.threerings.presents.server.InvocationDispatcher; import com.threerings.presents.server.InvocationDispatcher;
import com.threerings.presents.server.InvocationException; import com.threerings.presents.server.InvocationException;
@@ -24,7 +24,6 @@ package com.threerings.micasa.lobby;
import com.threerings.presents.client.Client; import com.threerings.presents.client.Client;
import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.data.InvocationMarshaller;
import com.threerings.presents.dobj.InvocationResponseEvent; import com.threerings.presents.dobj.InvocationResponseEvent;
import com.threerings.presents.net.Transport;
import java.util.List; import java.util.List;
/** /**
@@ -33,12 +33,12 @@ public interface LobbyProvider extends InvocationProvider
/** /**
* Handles a {@link LobbyService#getCategories} request. * Handles a {@link LobbyService#getCategories} request.
*/ */
public void getCategories (ClientObject caller, LobbyService.CategoriesListener arg1) void getCategories (ClientObject caller, LobbyService.CategoriesListener arg1)
throws InvocationException; throws InvocationException;
/** /**
* Handles a {@link LobbyService#getLobbies} request. * Handles a {@link LobbyService#getLobbies} request.
*/ */
public void getLobbies (ClientObject caller, String arg1, LobbyService.LobbiesListener arg2) void getLobbies (ClientObject caller, String arg1, LobbyService.LobbiesListener arg2)
throws InvocationException; throws InvocationException;
} }
@@ -68,6 +68,7 @@ public class LobbySelector extends JPanel
_loblist.setCellRenderer(new LobbyCellRenderer()); _loblist.setCellRenderer(new LobbyCellRenderer());
// add a mouse listener that tells us about double clicks // add a mouse listener that tells us about double clicks
MouseListener ml = new MouseAdapter() { MouseListener ml = new MouseAdapter() {
@Override
public void mouseClicked (MouseEvent e) { public void mouseClicked (MouseEvent e) {
if (e.getClickCount() == 2) { if (e.getClickCount() == 2) {
int index = _loblist.locationToIndex(e.getPoint()); int index = _loblist.locationToIndex(e.getPoint());
@@ -80,7 +81,7 @@ public class LobbySelector extends JPanel
add(_loblist, BorderLayout.CENTER); add(_loblist, BorderLayout.CENTER);
} }
// documentation inherited @Override
public void addNotify () public void addNotify ()
{ {
super.addNotify(); super.addNotify();
@@ -193,6 +194,7 @@ public class LobbySelector extends JPanel
protected static class LobbyCellRenderer protected static class LobbyCellRenderer
extends DefaultListCellRenderer extends DefaultListCellRenderer
{ {
@Override
public Component getListCellRendererComponent( public Component getListCellRendererComponent(
JList list, JList list,
Object value, Object value,
@@ -21,7 +21,6 @@
package com.threerings.micasa.lobby.table; package com.threerings.micasa.lobby.table;
import java.awt.Component;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.util.Iterator; import java.util.Iterator;
@@ -31,13 +31,13 @@ import com.threerings.micasa.util.MiCasaContext;
*/ */
public class TableLobbyConfig extends LobbyConfig public class TableLobbyConfig extends LobbyConfig
{ {
// documentation inherited @Override
public String getManagerClassName () public String getManagerClassName ()
{ {
return "com.threerings.micasa.lobby.table.TableLobbyManager"; return "com.threerings.micasa.lobby.table.TableLobbyManager";
} }
// documentation inherited @Override
public JComponent createMatchMakingView (MiCasaContext ctx) public JComponent createMatchMakingView (MiCasaContext ctx)
{ {
return new TableListView(ctx, this); return new TableListView(ctx, this);
@@ -30,7 +30,7 @@ import com.threerings.micasa.lobby.LobbyManager;
*/ */
public class TableLobbyManager extends LobbyManager public class TableLobbyManager extends LobbyManager
{ {
// documentation inherited @Override
protected void didStartup () protected void didStartup ()
{ {
super.didStartup(); super.didStartup();
@@ -38,7 +38,7 @@ public class TableLobbyManager extends LobbyManager
_tmgr = new TableManager(_omgr, _invmgr, _registry, getPlaceObject()); _tmgr = new TableManager(_omgr, _invmgr, _registry, getPlaceObject());
} }
// documentation inherited @Override
protected void didShutdown () protected void didShutdown ()
{ {
super.didShutdown(); super.didShutdown();
@@ -46,7 +46,7 @@ public class TableLobbyManager extends LobbyManager
_tmgr.shutdown(); _tmgr.shutdown();
} }
// documentation inherited @Override
protected PlaceObject createPlaceObject () protected PlaceObject createPlaceObject ()
{ {
return new TableLobbyObject(); return new TableLobbyObject();
@@ -72,6 +72,7 @@ public class SimpleClient
// log off when they close the window // log off when they close the window
_frame.getFrame().addWindowListener(new WindowAdapter() { _frame.getFrame().addWindowListener(new WindowAdapter() {
@Override
public void windowClosing (WindowEvent evt) { public void windowClosing (WindowEvent evt) {
// if we're logged on, log off // if we're logged on, log off
if (_client.isLoggedOn()) { if (_client.isLoggedOn()) {
@@ -125,10 +125,12 @@ public class SimulatorApp
// we want to exit when we logged off or failed to log on // we want to exit when we logged off or failed to log on
client.addClientObserver(new ClientAdapter() { client.addClientObserver(new ClientAdapter() {
@Override
public void clientFailedToLogon (Client c, Exception cause) { public void clientFailedToLogon (Client c, Exception cause) {
log.info("Client failed to logon: " + cause); log.info("Client failed to logon: " + cause);
System.exit(0); System.exit(0);
} }
@Override
public void clientDidLogoff (Client c) { public void clientDidLogoff (Client c) {
System.exit(0); System.exit(0);
} }
@@ -156,6 +158,7 @@ public class SimulatorApp
// in normal circumstances they are entirely different processes; // in normal circumstances they are entirely different processes;
// so we just wait half a second which does the job // so we just wait half a second which does the job
new Interval() { new Interval() {
@Override
public void expired () { public void expired () {
_client.getParlorContext().getClient().logon(); _client.getParlorContext().getClient().logon();
} }
@@ -210,6 +213,7 @@ public class SimulatorApp
_server = server; _server = server;
} }
@Override
public void run () public void run ()
{ {
_server.run(); _server.run();
@@ -63,7 +63,7 @@ public class SimulatorController extends Controller
_ctx.getClient().addClientObserver(this); _ctx.getClient().addClientObserver(this);
} }
// documentation inherited @Override
public boolean handleAction (ActionEvent action) public boolean handleAction (ActionEvent action)
{ {
String cmd = action.getActionCommand(); String cmd = action.getActionCommand();
@@ -32,6 +32,7 @@ public class SimulatorInfo
/** The number of players in the game. */ /** The number of players in the game. */
public int playerCount; public int playerCount;
@Override
public String toString () public String toString ()
{ {
return "[gameConfigClass=" + gameConfigClass + return "[gameConfigClass=" + gameConfigClass +
@@ -25,7 +25,6 @@ import com.threerings.micasa.simulator.client.SimulatorService;
import com.threerings.parlor.game.data.GameConfig; import com.threerings.parlor.game.data.GameConfig;
import com.threerings.presents.client.Client; import com.threerings.presents.client.Client;
import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.data.InvocationMarshaller;
import com.threerings.presents.net.Transport;
/** /**
* Provides the implementation of the {@link SimulatorService} interface * Provides the implementation of the {@link SimulatorService} interface
@@ -24,7 +24,6 @@ package com.threerings.micasa.simulator.server;
import com.threerings.micasa.simulator.data.SimulatorMarshaller; import com.threerings.micasa.simulator.data.SimulatorMarshaller;
import com.threerings.parlor.game.data.GameConfig; import com.threerings.parlor.game.data.GameConfig;
import com.threerings.presents.data.ClientObject; import com.threerings.presents.data.ClientObject;
import com.threerings.presents.data.InvocationMarshaller;
import com.threerings.presents.server.InvocationDispatcher; import com.threerings.presents.server.InvocationDispatcher;
import com.threerings.presents.server.InvocationException; import com.threerings.presents.server.InvocationException;
@@ -35,9 +35,7 @@ import com.threerings.presents.server.ClientResolutionListener;
import com.threerings.presents.server.InvocationManager; import com.threerings.presents.server.InvocationManager;
import com.threerings.crowd.data.BodyObject; import com.threerings.crowd.data.BodyObject;
import com.threerings.crowd.data.PlaceObject;
import com.threerings.crowd.server.LocationManager; import com.threerings.crowd.server.LocationManager;
import com.threerings.crowd.server.PlaceManager;
import com.threerings.crowd.server.PlaceRegistry; import com.threerings.crowd.server.PlaceRegistry;
import com.threerings.parlor.game.data.GameAI; import com.threerings.parlor.game.data.GameAI;
@@ -40,7 +40,7 @@ import static com.threerings.parlor.card.Log.log;
public abstract class CardGameController extends GameController public abstract class CardGameController extends GameController
implements TurnGameController, CardCodes, CardGameReceiver implements TurnGameController, CardCodes, CardGameReceiver
{ {
// Documentation inherited. @Override
public void willEnterPlace (PlaceObject plobj) public void willEnterPlace (PlaceObject plobj)
{ {
if (_ctx.getClient().getClientObject().receivers.containsKey( if (_ctx.getClient().getClientObject().receivers.containsKey(
@@ -56,7 +56,7 @@ public abstract class CardGameController extends GameController
super.willEnterPlace(plobj); super.willEnterPlace(plobj);
} }
// Documentation inherited. @Override
public void didLeavePlace (PlaceObject plobj) public void didLeavePlace (PlaceObject plobj)
{ {
super.didLeavePlace(plobj); super.didLeavePlace(plobj);
@@ -45,15 +45,10 @@ import com.threerings.media.sprite.Sprite;
import com.threerings.media.util.LinePath; import com.threerings.media.util.LinePath;
import com.threerings.media.util.Path; import com.threerings.media.util.Path;
import com.threerings.media.util.PathSequence; import com.threerings.media.util.PathSequence;
import com.threerings.media.util.Pathable;
import com.threerings.parlor.card.data.Card; import com.threerings.parlor.card.data.Card;
import com.threerings.parlor.card.data.CardCodes; import com.threerings.parlor.card.data.CardCodes;
import com.threerings.parlor.card.data.Deck;
import com.threerings.parlor.card.data.Hand; import com.threerings.parlor.card.data.Hand;
import static com.threerings.parlor.card.Log.log;
/** /**
* Extends VirtualMediaPanel to provide services specific to rendering and manipulating playing * Extends VirtualMediaPanel to provide services specific to rendering and manipulating playing
* cards. * cards.
@@ -842,7 +837,7 @@ public abstract class CardPanel extends VirtualMediaPanel
} }
} }
// documentation inherited @Override
protected void paintBehind (Graphics2D gfx, Rectangle dirtyRect) protected void paintBehind (Graphics2D gfx, Rectangle dirtyRect)
{ {
gfx.setColor(DEFAULT_BACKGROUND); gfx.setColor(DEFAULT_BACKGROUND);
@@ -854,6 +849,7 @@ public abstract class CardPanel extends VirtualMediaPanel
protected class HandSpriteObserver extends PathAdapter protected class HandSpriteObserver extends PathAdapter
implements CardSpriteObserver implements CardSpriteObserver
{ {
@Override
public void pathCompleted (Sprite sprite, Path path, long when) public void pathCompleted (Sprite sprite, Path path, long when)
{ {
updateActiveCardSprite(); updateActiveCardSprite();
@@ -897,6 +893,7 @@ public abstract class CardPanel extends VirtualMediaPanel
/** Listens for mouse interactions with cards. */ /** Listens for mouse interactions with cards. */
protected class CardListener extends MouseInputAdapter protected class CardListener extends MouseInputAdapter
{ {
@Override
public void mousePressed (MouseEvent me) public void mousePressed (MouseEvent me)
{ {
if (_activeCardSprite != null && if (_activeCardSprite != null &&
@@ -907,6 +904,7 @@ public abstract class CardPanel extends VirtualMediaPanel
} }
} }
@Override
public void mouseReleased (MouseEvent me) public void mouseReleased (MouseEvent me)
{ {
if (_activeCardSprite != null && if (_activeCardSprite != null &&
@@ -918,6 +916,7 @@ public abstract class CardPanel extends VirtualMediaPanel
} }
} }
@Override
public void mouseClicked (MouseEvent me) public void mouseClicked (MouseEvent me)
{ {
if (_activeCardSprite != null && if (_activeCardSprite != null &&
@@ -928,6 +927,7 @@ public abstract class CardPanel extends VirtualMediaPanel
} }
} }
@Override
public void mouseMoved (MouseEvent me) public void mouseMoved (MouseEvent me)
{ {
_mouseEvent = me; _mouseEvent = me;
@@ -935,6 +935,7 @@ public abstract class CardPanel extends VirtualMediaPanel
updateActiveCardSprite(); updateActiveCardSprite();
} }
@Override
public void mouseDragged (MouseEvent me) public void mouseDragged (MouseEvent me)
{ {
_mouseEvent = me; _mouseEvent = me;
@@ -953,11 +954,13 @@ public abstract class CardPanel extends VirtualMediaPanel
} }
} }
@Override
public void mouseEntered (MouseEvent me) public void mouseEntered (MouseEvent me)
{ {
_mouseEvent = me; _mouseEvent = me;
} }
@Override
public void mouseExited (MouseEvent me) public void mouseExited (MouseEvent me)
{ {
_mouseEvent = me; _mouseEvent = me;
@@ -1106,6 +1109,7 @@ public abstract class CardPanel extends VirtualMediaPanel
/** A path observer that removes the sprite at the end of its path. */ /** A path observer that removes the sprite at the end of its path. */
protected PathAdapter _pathEndRemover = new PathAdapter() { protected PathAdapter _pathEndRemover = new PathAdapter() {
@Override
public void pathCompleted (Sprite sprite, Path path, long when) { public void pathCompleted (Sprite sprite, Path path, long when) {
removeSprite(sprite); removeSprite(sprite);
} }
@@ -24,11 +24,7 @@ package com.threerings.parlor.card.client;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.awt.geom.AffineTransform; import java.awt.geom.AffineTransform;
import com.threerings.media.AbstractMedia;
import com.threerings.media.image.Mirage;
import com.threerings.media.sprite.FadableImageSprite; import com.threerings.media.sprite.FadableImageSprite;
import com.threerings.media.util.Path;
import com.threerings.parlor.card.data.Card; import com.threerings.parlor.card.data.Card;
/** /**
@@ -144,7 +140,7 @@ public class CardSprite extends FadableImageSprite
_scaleFactor = 1.0; _scaleFactor = 1.0;
} }
// Documentation inherited. @Override
public void tick (long tickStamp) public void tick (long tickStamp)
{ {
super.tick(tickStamp); super.tick(tickStamp);
@@ -183,7 +179,7 @@ public class CardSprite extends FadableImageSprite
} }
// Documentation inherited. @Override
public void paint (Graphics2D gfx) public void paint (Graphics2D gfx)
{ {
if (_scaleFactor <= 0) { if (_scaleFactor <= 0) {
@@ -49,9 +49,7 @@ public class MicroCardSprite extends CardSprite
super(panel, card, facingUp); super(panel, card, facingUp);
} }
/** @Override
* Updates the mirage according to the current state.
*/
protected void updateMirage () protected void updateMirage ()
{ {
setMirage((_card != null && _facingUp ) ? setMirage((_card != null && _facingUp ) ?
@@ -21,10 +21,6 @@
package com.threerings.parlor.card.data; package com.threerings.parlor.card.data;
import java.io.IOException;
import com.threerings.io.ObjectInputStream;
import com.threerings.io.ObjectOutputStream;
import com.threerings.util.ActionScript; import com.threerings.util.ActionScript;
import com.threerings.presents.dobj.DSet; import com.threerings.presents.dobj.DSet;
@@ -144,22 +140,13 @@ public class Card implements DSet.Entry, Comparable, CardCodes
return _key; return _key;
} }
/** @Override
* Returns a hash code for this card.
*
* @return this card's hash code
*/
public int hashCode () public int hashCode ()
{ {
return _value; return _value;
} }
/** @Override
* Checks this card for equality with another.
*
* @param other the other card to compare
* @return true if the cards are equal, false otherwise
*/
public boolean equals (Object other) public boolean equals (Object other)
{ {
if (other instanceof Card) { if (other instanceof Card) {
@@ -193,11 +180,7 @@ public class Card implements DSet.Entry, Comparable, CardCodes
} }
} }
/** @Override
* Returns a string representation of this card.
*
* @return a description of this card
*/
public String toString () public String toString ()
{ {
int number = getNumber(); int number = getNumber();
@@ -21,7 +21,6 @@
package com.threerings.parlor.card.server; package com.threerings.parlor.card.server;
import com.threerings.crowd.data.BodyObject;
import com.threerings.crowd.data.OccupantInfo; import com.threerings.crowd.data.OccupantInfo;
import com.threerings.crowd.server.OccupantOp; import com.threerings.crowd.server.OccupantOp;
@@ -34,12 +33,7 @@ import com.threerings.parlor.game.data.GameObject;
import com.threerings.parlor.game.server.GameManager; import com.threerings.parlor.game.server.GameManager;
import com.threerings.parlor.turn.server.TurnGameManager; import com.threerings.parlor.turn.server.TurnGameManager;
import com.threerings.presents.client.InvocationService.ConfirmListener;
import com.threerings.presents.data.ClientObject; import com.threerings.presents.data.ClientObject;
import com.threerings.presents.dobj.MessageEvent;
import com.threerings.presents.server.InvocationException;
import static com.threerings.parlor.card.Log.log;
/** /**
* A manager class for card games. Handles common functions like dealing * A manager class for card games. Handles common functions like dealing
@@ -48,7 +42,7 @@ import static com.threerings.parlor.card.Log.log;
public class CardGameManager extends GameManager public class CardGameManager extends GameManager
implements TurnGameManager, CardCodes implements TurnGameManager, CardCodes
{ {
// Documentation inherited. @Override
protected void didStartup () protected void didStartup ()
{ {
super.didStartup(); super.didStartup();
@@ -67,7 +61,7 @@ public class CardGameManager extends GameManager
public void turnDidEnd () public void turnDidEnd ()
{} {}
@Override // documentation inherited @Override
protected void gameDidEnd () protected void gameDidEnd ()
{ {
// Copy off our player oids so we have them handy to see if somebody was a player for // Copy off our player oids so we have them handy to see if somebody was a player for
@@ -26,7 +26,6 @@ import com.threerings.parlor.card.client.CardGameReceiver;
import com.threerings.parlor.card.data.Card; import com.threerings.parlor.card.data.Card;
import com.threerings.parlor.card.data.Hand; import com.threerings.parlor.card.data.Hand;
import com.threerings.presents.data.ClientObject; import com.threerings.presents.data.ClientObject;
import com.threerings.presents.net.Transport;
import com.threerings.presents.server.InvocationSender; import com.threerings.presents.server.InvocationSender;
/** /**
@@ -25,7 +25,6 @@ import com.threerings.parlor.card.data.Card;
import com.threerings.parlor.card.trick.client.TrickCardGameService; import com.threerings.parlor.card.trick.client.TrickCardGameService;
import com.threerings.presents.client.Client; import com.threerings.presents.client.Client;
import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.data.InvocationMarshaller;
import com.threerings.presents.net.Transport;
/** /**
* Provides the implementation of the {@link TrickCardGameService} interface * Provides the implementation of the {@link TrickCardGameService} interface
@@ -24,7 +24,6 @@ package com.threerings.parlor.card.trick.server;
import com.threerings.parlor.card.data.Card; import com.threerings.parlor.card.data.Card;
import com.threerings.parlor.card.trick.data.TrickCardGameMarshaller; import com.threerings.parlor.card.trick.data.TrickCardGameMarshaller;
import com.threerings.presents.data.ClientObject; import com.threerings.presents.data.ClientObject;
import com.threerings.presents.data.InvocationMarshaller;
import com.threerings.presents.server.InvocationDispatcher; import com.threerings.presents.server.InvocationDispatcher;
import com.threerings.presents.server.InvocationException; import com.threerings.presents.server.InvocationException;
@@ -67,14 +67,14 @@ public class TrickCardGameManagerDelegate extends TurnGameManagerDelegate
{ {
} }
@Override // from PlaceManagerDelegate @Override
public void didInit (PlaceConfig config) public void didInit (PlaceConfig config)
{ {
super.didInit(config); super.didInit(config);
_cgmgr = (CardGameManager)_plmgr; _cgmgr = (CardGameManager)_plmgr;
} }
@Override // from PlaceManagerDelegate @Override
public void didStartup (PlaceObject plobj) public void didStartup (PlaceObject plobj)
{ {
super.didStartup(plobj); super.didStartup(plobj);
@@ -86,7 +86,7 @@ public class TrickCardGameManagerDelegate extends TurnGameManagerDelegate
_invmgr.registerDispatcher(new TrickCardGameDispatcher(this))); _invmgr.registerDispatcher(new TrickCardGameDispatcher(this)));
} }
@Override // from PlaceManagerDelegate @Override
public void didShutdown () public void didShutdown ()
{ {
super.didShutdown(); super.didShutdown();
@@ -94,7 +94,7 @@ public class TrickCardGameManagerDelegate extends TurnGameManagerDelegate
_invmgr.clearDispatcher(_trickCardGame.getTrickCardGameService()); _invmgr.clearDispatcher(_trickCardGame.getTrickCardGameService());
} }
@Override // from GameManagerDelegate @Override
public void gameWillStart () public void gameWillStart ()
{ {
super.gameWillStart(); super.gameWillStart();
@@ -111,6 +111,7 @@ public class TrickCardGameManagerDelegate extends TurnGameManagerDelegate
/** /**
* Called when the game has started. Default implementation starts the first hand. * Called when the game has started. Default implementation starts the first hand.
*/ */
@Override
public void gameDidStart () public void gameDidStart ()
{ {
super.gameDidStart(); super.gameDidStart();
@@ -119,7 +120,7 @@ public class TrickCardGameManagerDelegate extends TurnGameManagerDelegate
startHand(); startHand();
} }
@Override // from GameManagerDelegate @Override
public void gameDidEnd () public void gameDidEnd ()
{ {
super.gameDidEnd(); super.gameDidEnd();
@@ -137,7 +138,7 @@ public class TrickCardGameManagerDelegate extends TurnGameManagerDelegate
_trickCardGame.setRematchRequests(new int[_cardGame.getPlayerCount()]); _trickCardGame.setRematchRequests(new int[_cardGame.getPlayerCount()]);
} }
@Override // from TurnGameManagerDelegate @Override
public void startTurn () public void startTurn ()
{ {
super.startTurn(); super.startTurn();
@@ -147,7 +148,7 @@ public class TrickCardGameManagerDelegate extends TurnGameManagerDelegate
_turnTimeoutInterval.schedule(_trickCardGame.getTurnDuration()); _turnTimeoutInterval.schedule(_trickCardGame.getTurnDuration());
} }
@Override // from TurnGameManagerDelegate @Override
public void endTurn () public void endTurn ()
{ {
// cancel the timeout interval // cancel the timeout interval
@@ -376,7 +377,7 @@ public class TrickCardGameManagerDelegate extends TurnGameManagerDelegate
return _trickCardGame.getCardsPlayed().length == _cardGame.getPlayerCount(); return _trickCardGame.getCardsPlayed().length == _cardGame.getPlayerCount();
} }
@Override // from TurnGameManagerDelegate @Override
protected void setFirstTurnHolder () protected void setFirstTurnHolder ()
{ {
if (_trickCardGame.getTrickState() == TrickCardGameObject.PLAYING_TRICK) { if (_trickCardGame.getTrickState() == TrickCardGameObject.PLAYING_TRICK) {
@@ -387,7 +388,7 @@ public class TrickCardGameManagerDelegate extends TurnGameManagerDelegate
} }
} }
@Override // from TurnGameManagerDelegate @Override
protected void setNextTurnHolder () protected void setNextTurnHolder ()
{ {
if (_trickCardGame.getTrickState() == TrickCardGameObject.PLAYING_TRICK && if (_trickCardGame.getTrickState() == TrickCardGameObject.PLAYING_TRICK &&
@@ -571,6 +572,7 @@ public class TrickCardGameManagerDelegate extends TurnGameManagerDelegate
/** The all-purpose turn timeout interval. */ /** The all-purpose turn timeout interval. */
protected Interval _turnTimeoutInterval = new Interval(_omgr) { protected Interval _turnTimeoutInterval = new Interval(_omgr) {
@Override
public void expired () { public void expired () {
_turnTimedOut = true; _turnTimedOut = true;
turnTimedOut(); turnTimedOut();
@@ -579,6 +581,7 @@ public class TrickCardGameManagerDelegate extends TurnGameManagerDelegate
/** Calls {@link #endTrick} upon expiration. */ /** Calls {@link #endTrick} upon expiration. */
protected Interval _endTrickInterval = new Interval(_omgr) { protected Interval _endTrickInterval = new Interval(_omgr) {
@Override
public void expired () { public void expired () {
endTrick(); endTrick();
} }
@@ -33,15 +33,15 @@ public interface TrickCardGameProvider extends InvocationProvider
/** /**
* Handles a {@link TrickCardGameService#playCard} request. * Handles a {@link TrickCardGameService#playCard} request.
*/ */
public void playCard (ClientObject caller, Card arg1, int arg2); void playCard (ClientObject caller, Card arg1, int arg2);
/** /**
* Handles a {@link TrickCardGameService#requestRematch} request. * Handles a {@link TrickCardGameService#requestRematch} request.
*/ */
public void requestRematch (ClientObject caller); void requestRematch (ClientObject caller);
/** /**
* Handles a {@link TrickCardGameService#sendCardsToPlayer} request. * Handles a {@link TrickCardGameService#sendCardsToPlayer} request.
*/ */
public void sendCardsToPlayer (ClientObject caller, int arg1, Card[] arg2); void sendCardsToPlayer (ClientObject caller, int arg1, Card[] arg2);
} }
@@ -23,16 +23,8 @@ package com.threerings.parlor.client;
import javax.swing.JCheckBox; import javax.swing.JCheckBox;
import javax.swing.JLabel; import javax.swing.JLabel;
import javax.swing.JPanel;
import com.samskivert.swing.SimpleSlider; import com.samskivert.swing.SimpleSlider;
import com.samskivert.swing.VGroupLayout;
import com.threerings.parlor.data.TableConfig;
import com.threerings.parlor.util.ParlorContext;
import com.threerings.parlor.game.client.SwingGameConfigurator; import com.threerings.parlor.game.client.SwingGameConfigurator;
import com.threerings.parlor.game.data.GameConfig;
/** /**
* Provides a default implementation of a TableConfigurator for * Provides a default implementation of a TableConfigurator for
@@ -83,7 +75,7 @@ public class DefaultSwingTableConfigurator extends TableConfigurator
} }
} }
// documentation inherited @Override
protected void createConfigInterface () protected void createConfigInterface ()
{ {
super.createConfigInterface(); super.createConfigInterface();
@@ -101,13 +93,13 @@ public class DefaultSwingTableConfigurator extends TableConfigurator
} }
} }
// documentation inherited @Override
public boolean isEmpty () public boolean isEmpty ()
{ {
return (_playerSlider == null) && (_privateCheck == null); return (_playerSlider == null) && (_privateCheck == null);
} }
// documentation inherited @Override
protected void flushTableConfig() protected void flushTableConfig()
{ {
super.flushTableConfig(); super.flushTableConfig();
@@ -186,7 +186,7 @@ public class Invitation
} }
} }
/** Returns a string representation of this invitation record. */ @Override
public String toString () public String toString ()
{ {
return "[inviteId=" + inviteId + ", opponent=" + opponent + return "[inviteId=" + inviteId + ", opponent=" + opponent +
@@ -122,7 +122,7 @@ public class ParlorDirector extends BasicDirector
_pservice.startSolitaire(_ctx.getClient(), config, listener); _pservice.startSolitaire(_ctx.getClient(), config, listener);
} }
// documentation inherited @Override
public void clientDidLogoff (Client client) public void clientDidLogoff (Client client)
{ {
super.clientDidLogoff(client); super.clientDidLogoff(client);
@@ -188,13 +188,13 @@ public class ParlorDirector extends BasicDirector
// TBD // TBD
} }
@Override // from BasicDirector @Override
protected void registerServices (Client client) protected void registerServices (Client client)
{ {
client.addServiceGroup(PARLOR_GROUP); client.addServiceGroup(PARLOR_GROUP);
} }
@Override // from BasicDirector @Override
protected void fetchServices (Client client) protected void fetchServices (Client client)
{ {
// get a handle on our parlor services // get a handle on our parlor services
@@ -219,7 +219,7 @@ public class TableDirector extends BasicDirector
_tlobj.getTableService().startTableNow(_ctx.getClient(), tableId, this); _tlobj.getTableService().startTableNow(_ctx.getClient(), tableId, this);
} }
// documentation inherited @Override
public void clientDidLogoff (Client client) public void clientDidLogoff (Client client)
{ {
super.clientDidLogoff(client); super.clientDidLogoff(client);
@@ -29,7 +29,7 @@ public abstract class Parameter implements Streamable
/** Returns the default value of this parameter. */ /** Returns the default value of this parameter. */
public abstract Object getDefaultValue (); public abstract Object getDefaultValue ();
/** Generates a string representation of this instance. */ @Override
public String toString () public String toString ()
{ {
return StringUtil.fieldsToString(this); return StringUtil.fieldsToString(this);
@@ -27,7 +27,6 @@ import com.threerings.presents.client.Client;
import com.threerings.presents.client.InvocationService; import com.threerings.presents.client.InvocationService;
import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.data.InvocationMarshaller;
import com.threerings.presents.dobj.InvocationResponseEvent; import com.threerings.presents.dobj.InvocationResponseEvent;
import com.threerings.presents.net.Transport;
import com.threerings.util.Name; import com.threerings.util.Name;
/** /**
@@ -385,21 +385,19 @@ public class Table
return tableId; return tableId;
} }
// documentation inherited @Override
public boolean equals (Object other) public boolean equals (Object other)
{ {
return (other instanceof Table) && (tableId == ((Table) other).tableId); return (other instanceof Table) && (tableId == ((Table) other).tableId);
} }
// documentation inherited @Override
public int hashCode () public int hashCode ()
{ {
return tableId; return tableId;
} }
/** @Override
* Generates a string representation of this table instance.
*/
public String toString () public String toString ()
{ {
StringBuilder buf = new StringBuilder(); StringBuilder buf = new StringBuilder();
@@ -26,7 +26,6 @@ import com.threerings.parlor.game.data.GameConfig;
import com.threerings.presents.client.Client; import com.threerings.presents.client.Client;
import com.threerings.presents.client.InvocationService; import com.threerings.presents.client.InvocationService;
import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.data.InvocationMarshaller;
import com.threerings.presents.net.Transport;
/** /**
* Provides the implementation of the {@link TableService} interface * Provides the implementation of the {@link TableService} interface
@@ -61,6 +61,7 @@ public abstract class GameController extends PlaceController
* @param config the configuration of the game we are intended to * @param config the configuration of the game we are intended to
* control. * control.
*/ */
@Override
public void init (CrowdContext ctx, PlaceConfig config) public void init (CrowdContext ctx, PlaceConfig config)
{ {
// cast our references before we call super.init() so that when super.init() calls // cast our references before we call super.init() so that when super.init() calls
@@ -75,6 +76,7 @@ public abstract class GameController extends PlaceController
* Adds this controller as a listener to the game object (thus derived classes need not do so) * Adds this controller as a listener to the game object (thus derived classes need not do so)
* and lets the game manager know that we are now ready to go. * and lets the game manager know that we are now ready to go.
*/ */
@Override
public void willEnterPlace (PlaceObject plobj) public void willEnterPlace (PlaceObject plobj)
{ {
super.willEnterPlace(plobj); super.willEnterPlace(plobj);
@@ -109,6 +111,7 @@ public abstract class GameController extends PlaceController
/** /**
* Removes our listener registration from the game object and cleans house. * Removes our listener registration from the game object and cleans house.
*/ */
@Override
public void didLeavePlace (PlaceObject plobj) public void didLeavePlace (PlaceObject plobj)
{ {
super.didLeavePlace(plobj); super.didLeavePlace(plobj);
@@ -174,6 +177,7 @@ public abstract class GameController extends PlaceController
* Handles basic game controller action events. Derived classes should be sure to call * Handles basic game controller action events. Derived classes should be sure to call
* <code>super.handleAction</code> for events they don't specifically handle. * <code>super.handleAction</code> for events they don't specifically handle.
*/ */
@Override
public boolean handleAction (ActionEvent action) public boolean handleAction (ActionEvent action)
{ {
return super.handleAction(action); return super.handleAction(action);
@@ -249,6 +253,7 @@ public abstract class GameController extends PlaceController
// let our delegates do their business // let our delegates do their business
applyToDelegates(new DelegateOp(GameControllerDelegate.class) { applyToDelegates(new DelegateOp(GameControllerDelegate.class) {
@Override
public void apply (PlaceControllerDelegate delegate) { public void apply (PlaceControllerDelegate delegate) {
((GameControllerDelegate)delegate).gameDidStart(); ((GameControllerDelegate)delegate).gameDidStart();
} }
@@ -263,6 +268,7 @@ public abstract class GameController extends PlaceController
{ {
// let our delegates do their business // let our delegates do their business
applyToDelegates(new DelegateOp(GameControllerDelegate.class) { applyToDelegates(new DelegateOp(GameControllerDelegate.class) {
@Override
public void apply (PlaceControllerDelegate delegate) { public void apply (PlaceControllerDelegate delegate) {
((GameControllerDelegate)delegate).gameDidEnd(); ((GameControllerDelegate)delegate).gameDidEnd();
} }
@@ -276,6 +282,7 @@ public abstract class GameController extends PlaceController
{ {
// let our delegates do their business // let our delegates do their business
applyToDelegates(new DelegateOp(GameControllerDelegate.class) { applyToDelegates(new DelegateOp(GameControllerDelegate.class) {
@Override
public void apply (PlaceControllerDelegate delegate) { public void apply (PlaceControllerDelegate delegate) {
((GameControllerDelegate)delegate).gameWasCancelled(); ((GameControllerDelegate)delegate).gameWasCancelled();
} }
@@ -290,6 +297,7 @@ public abstract class GameController extends PlaceController
{ {
// let our delegates do their business // let our delegates do their business
applyToDelegates(new DelegateOp(GameControllerDelegate.class) { applyToDelegates(new DelegateOp(GameControllerDelegate.class) {
@Override
public void apply (PlaceControllerDelegate delegate) { public void apply (PlaceControllerDelegate delegate) {
((GameControllerDelegate)delegate).gameWillReset(); ((GameControllerDelegate)delegate).gameWillReset();
} }
@@ -28,10 +28,7 @@ import java.awt.Insets;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JPanel; import javax.swing.JPanel;
import com.samskivert.swing.VGroupLayout;
import com.threerings.parlor.game.data.GameConfig; import com.threerings.parlor.game.data.GameConfig;
import com.threerings.parlor.util.ParlorContext;
/** /**
* Provides the base from which interfaces can be built to configure games * Provides the base from which interfaces can be built to configure games
@@ -125,6 +125,7 @@ public abstract class GameConfig extends PlaceConfig implements Cloneable
* Returns true if this game config object is equal to the supplied object (meaning it is a * Returns true if this game config object is equal to the supplied object (meaning it is a
* game config for the same game and its configuration settings are the same as ours). * game config for the same game and its configuration settings are the same as ours).
*/ */
@Override
public boolean equals (Object other) public boolean equals (Object other)
{ {
if (!(other instanceof GameConfig)) { if (!(other instanceof GameConfig)) {
@@ -138,13 +139,14 @@ public abstract class GameConfig extends PlaceConfig implements Cloneable
* Computes a hashcode for this game config object that supports our {@link #equals} * Computes a hashcode for this game config object that supports our {@link #equals}
* implementation. Objects that are equal should have the same hashcode. * implementation. Objects that are equal should have the same hashcode.
*/ */
@Override
public int hashCode () public int hashCode ()
{ {
// look ma, it's so sophisticated! // look ma, it's so sophisticated!
return getClass().hashCode() + (rated ? 1 : 0); return getClass().hashCode() + (rated ? 1 : 0);
} }
// documentation inherited @Override
public Object clone () public Object clone ()
{ {
try { try {
@@ -238,7 +238,7 @@ public class GameObject extends PlaceObject
return playerStatus == PLAYER_IN_PLAY; return playerStatus == PLAYER_IN_PLAY;
} }
// documentation inherited @Override
protected void which (StringBuilder buf) protected void which (StringBuilder buf)
{ {
super.which(buf); super.which(buf);
@@ -23,8 +23,6 @@ package com.threerings.parlor.game.server;
import java.util.List; import java.util.List;
import java.util.Arrays; import java.util.Arrays;
import java.util.logging.Level;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.samskivert.util.ArrayIntSet; import com.samskivert.util.ArrayIntSet;
@@ -243,6 +241,7 @@ public class GameManager extends PlaceManager
// notify our delegates // notify our delegates
applyToDelegates(new DelegateOp(GameManagerDelegate.class) { applyToDelegates(new DelegateOp(GameManagerDelegate.class) {
@Override
public void apply (PlaceManagerDelegate delegate) { public void apply (PlaceManagerDelegate delegate) {
((GameManagerDelegate)delegate).playerWasReplaced(pidx, oplayer, player); ((GameManagerDelegate)delegate).playerWasReplaced(pidx, oplayer, player);
} }
@@ -285,6 +284,7 @@ public class GameManager extends PlaceManager
// let the delegates know that the player's been made an AI // let the delegates know that the player's been made an AI
applyToDelegates(new DelegateOp(GameManagerDelegate.class) { applyToDelegates(new DelegateOp(GameManagerDelegate.class) {
@Override
public void apply (PlaceManagerDelegate delegate) { public void apply (PlaceManagerDelegate delegate) {
((GameManagerDelegate)delegate).setAI(pidx, ai); ((GameManagerDelegate)delegate).setAI(pidx, ai);
} }
@@ -730,7 +730,7 @@ public class GameManager extends PlaceManager
} }
} }
@Override // from PlaceManager @Override
protected void didInit () protected void didInit ()
{ {
super.didInit(); super.didInit();
@@ -740,6 +740,7 @@ public class GameManager extends PlaceManager
// start up our tick interval // start up our tick interval
_tickInterval = new Interval(_omgr) { _tickInterval = new Interval(_omgr) {
@Override
public void expired () { public void expired () {
tick(System.currentTimeMillis()); tick(System.currentTimeMillis());
} }
@@ -754,7 +755,7 @@ public class GameManager extends PlaceManager
} }
} }
@Override // from PlaceManager @Override
protected void didStartup () protected void didStartup ()
{ {
// obtain a casted reference to our game object // obtain a casted reference to our game object
@@ -799,6 +800,7 @@ public class GameManager extends PlaceManager
// start up a no-show timer if needed // start up a no-show timer if needed
if (needsNoShowTimer()) { if (needsNoShowTimer()) {
_noShowInterval = new Interval(_omgr) { _noShowInterval = new Interval(_omgr) {
@Override
public void expired () { public void expired () {
checkForNoShows(); checkForNoShows();
} }
@@ -807,7 +809,7 @@ public class GameManager extends PlaceManager
} }
} }
@Override // from PlaceManager @Override
protected void didShutdown () protected void didShutdown ()
{ {
super.didShutdown(); super.didShutdown();
@@ -822,7 +824,7 @@ public class GameManager extends PlaceManager
} }
} }
@Override // from PlaceManager @Override
protected void bodyLeft (int bodyOid) protected void bodyLeft (int bodyOid)
{ {
// first resign the player from the game // first resign the player from the game
@@ -878,7 +880,7 @@ public class GameManager extends PlaceManager
} }
} }
@Override // from GameManager @Override
protected void checkShutdownInterval () protected void checkShutdownInterval ()
{ {
// PlaceManager will attempt to set up an idle shutdown interval when it is first created // PlaceManager will attempt to set up an idle shutdown interval when it is first created
@@ -975,6 +977,7 @@ public class GameManager extends PlaceManager
// let our delegates do their business // let our delegates do their business
applyToDelegates(new DelegateOp(GameManagerDelegate.class) { applyToDelegates(new DelegateOp(GameManagerDelegate.class) {
@Override
public void apply (PlaceManagerDelegate delegate) { public void apply (PlaceManagerDelegate delegate) {
((GameManagerDelegate)delegate).gameWillStart(); ((GameManagerDelegate)delegate).gameWillStart();
} }
@@ -1035,6 +1038,7 @@ public class GameManager extends PlaceManager
// let our delegates do their business // let our delegates do their business
applyToDelegates(new DelegateOp(GameManagerDelegate.class) { applyToDelegates(new DelegateOp(GameManagerDelegate.class) {
@Override
public void apply (PlaceManagerDelegate delegate) { public void apply (PlaceManagerDelegate delegate) {
((GameManagerDelegate)delegate).gameDidStart(); ((GameManagerDelegate)delegate).gameDidStart();
} }
@@ -1071,6 +1075,7 @@ public class GameManager extends PlaceManager
{ {
if (_aiTicker == null) { if (_aiTicker == null) {
_aiTicker = new Interval(_omgr) { _aiTicker = new Interval(_omgr) {
@Override
public void expired () { public void expired () {
tickAIs(); tickAIs();
} }
@@ -1108,6 +1113,7 @@ public class GameManager extends PlaceManager
protected void tickAI (final int pidx, final GameAI ai) protected void tickAI (final int pidx, final GameAI ai)
{ {
applyToDelegates(new DelegateOp(GameManagerDelegate.class) { applyToDelegates(new DelegateOp(GameManagerDelegate.class) {
@Override
public void apply (PlaceManagerDelegate delegate) { public void apply (PlaceManagerDelegate delegate) {
((GameManagerDelegate) delegate).tickAI(pidx, ai); ((GameManagerDelegate) delegate).tickAI(pidx, ai);
} }
@@ -1174,6 +1180,7 @@ public class GameManager extends PlaceManager
{ {
// let our delegates do their business // let our delegates do their business
applyToDelegates(new DelegateOp(GameManagerDelegate.class) { applyToDelegates(new DelegateOp(GameManagerDelegate.class) {
@Override
public void apply (PlaceManagerDelegate delegate) { public void apply (PlaceManagerDelegate delegate) {
((GameManagerDelegate)delegate).gameWillEnd(); ((GameManagerDelegate)delegate).gameWillEnd();
} }
@@ -1192,6 +1199,7 @@ public class GameManager extends PlaceManager
// let our delegates do their business // let our delegates do their business
applyToDelegates(new DelegateOp(GameManagerDelegate.class) { applyToDelegates(new DelegateOp(GameManagerDelegate.class) {
@Override
public void apply (PlaceManagerDelegate delegate) { public void apply (PlaceManagerDelegate delegate) {
((GameManagerDelegate)delegate).gameDidEnd(); ((GameManagerDelegate)delegate).gameDidEnd();
} }
@@ -1268,6 +1276,7 @@ public class GameManager extends PlaceManager
// let our delegates do their business // let our delegates do their business
applyToDelegates(new DelegateOp(GameManagerDelegate.class) { applyToDelegates(new DelegateOp(GameManagerDelegate.class) {
@Override
public void apply (PlaceManagerDelegate delegate) { public void apply (PlaceManagerDelegate delegate) {
((GameManagerDelegate)delegate).gameWillReset(); ((GameManagerDelegate)delegate).gameWillReset();
} }
@@ -24,7 +24,6 @@ package com.threerings.parlor.game.server;
import com.threerings.presents.dobj.AttributeChangeListener; import com.threerings.presents.dobj.AttributeChangeListener;
import com.threerings.presents.dobj.AttributeChangedEvent; import com.threerings.presents.dobj.AttributeChangedEvent;
import com.threerings.crowd.data.PlaceObject;
import com.threerings.crowd.server.PlaceManager; import com.threerings.crowd.server.PlaceManager;
import com.threerings.parlor.game.data.GameObject; import com.threerings.parlor.game.data.GameObject;
@@ -26,15 +26,10 @@ import static com.threerings.parlor.Log.log;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.logging.Level;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.samskivert.io.PersistenceException;
import com.samskivert.jdbc.RepositoryUnit; import com.samskivert.jdbc.RepositoryUnit;
import com.samskivert.util.ArrayIntSet;
import com.samskivert.util.ArrayUtil;
import com.samskivert.util.IntMap; import com.samskivert.util.IntMap;
import com.samskivert.util.IntMaps; import com.samskivert.util.IntMaps;
import com.samskivert.util.Invoker; import com.samskivert.util.Invoker;
@@ -67,7 +62,7 @@ public abstract class RatingManagerDelegate extends GameManagerDelegate
_invoker = invoker; _invoker = invoker;
} }
@Override // from PlaceManagerDelegate @Override
public void didInit (PlaceConfig config) public void didInit (PlaceConfig config)
{ {
super.didInit(config); super.didInit(config);
@@ -75,14 +70,14 @@ public abstract class RatingManagerDelegate extends GameManagerDelegate
_repo = getRatingRepository(); _repo = getRatingRepository();
} }
@Override // from PlaceManagerDelegate @Override
public void didStartup (PlaceObject plobj) public void didStartup (PlaceObject plobj)
{ {
super.didStartup(plobj); super.didStartup(plobj);
_gobj = (GameObject) plobj; _gobj = (GameObject) plobj;
} }
@Override // from PlaceManagerDelegate @Override
public void bodyEntered (int bodyOid) public void bodyEntered (int bodyOid)
{ {
super.bodyEntered(bodyOid); super.bodyEntered(bodyOid);
@@ -97,7 +92,7 @@ public abstract class RatingManagerDelegate extends GameManagerDelegate
} }
} }
@Override // from PlaceManagerDelegate @Override
public void bodyLeft (int bodyOid) public void bodyLeft (int bodyOid)
{ {
super.bodyLeft(bodyOid); super.bodyLeft(bodyOid);
@@ -111,7 +106,7 @@ public abstract class RatingManagerDelegate extends GameManagerDelegate
} }
} }
@Override // from GameManagerDelegate @Override
public void gameWillStart () public void gameWillStart ()
{ {
super.gameWillStart(); super.gameWillStart();
@@ -144,7 +139,7 @@ public abstract class RatingManagerDelegate extends GameManagerDelegate
loadRatings(toLoad); loadRatings(toLoad);
} }
@Override // from GameManagerDelegate @Override
public void gameDidEnd () public void gameDidEnd ()
{ {
super.gameDidEnd(); super.gameDidEnd();
@@ -224,6 +219,7 @@ public abstract class RatingManagerDelegate extends GameManagerDelegate
final int gameId = getGameId(); final int gameId = getGameId();
_invoker.postUnit(new RepositoryUnit("loadRatings(" + gameId + ")") { _invoker.postUnit(new RepositoryUnit("loadRatings(" + gameId + ")") {
@Override
public void invokePersist () throws Exception { public void invokePersist () throws Exception {
// map the records by player id so that we can correlate with the db results // map the records by player id so that we can correlate with the db results
IntMap<Rating> map = IntMaps.newHashIntMap(); IntMap<Rating> map = IntMaps.newHashIntMap();
@@ -242,6 +238,7 @@ public abstract class RatingManagerDelegate extends GameManagerDelegate
} }
} }
@Override
public void handleSuccess () { public void handleSuccess () {
// stuff our populated records into the _ratings mapping // stuff our populated records into the _ratings mapping
for (Rating rating : ratings) { for (Rating rating : ratings) {
@@ -259,12 +256,14 @@ public abstract class RatingManagerDelegate extends GameManagerDelegate
final int gameId = getGameId(); final int gameId = getGameId();
_invoker.postUnit(new RepositoryUnit("saveRatings(" + gameId + ")") { _invoker.postUnit(new RepositoryUnit("saveRatings(" + gameId + ")") {
@Override
public void invokePersist () throws Exception { public void invokePersist () throws Exception {
for (Rating rating : ratings) { for (Rating rating : ratings) {
_repo.setRating(gameId, rating.playerId, rating.rating, rating.experience); _repo.setRating(gameId, rating.playerId, rating.rating, rating.experience);
} }
} }
@Override
public void handleSuccess () { public void handleSuccess () {
// let subclasses publish the new ratings if they so desire // let subclasses publish the new ratings if they so desire
for (Rating rating : ratings) { for (Rating rating : ratings) {
@@ -460,7 +459,7 @@ public abstract class RatingManagerDelegate extends GameManagerDelegate
} }
} }
@Override // from Object @Override
public String toString () public String toString ()
{ {
return StringUtil.fieldsToString(this); return StringUtil.fieldsToString(this);
@@ -32,12 +32,9 @@ import com.google.inject.Singleton;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.samskivert.io.PersistenceException; import com.samskivert.io.PersistenceException;
import com.samskivert.util.HashIntMap;
import com.samskivert.util.IntMap;
import com.samskivert.util.IntSet; import com.samskivert.util.IntSet;
import com.samskivert.jdbc.depot.DepotRepository; import com.samskivert.jdbc.depot.DepotRepository;
import com.samskivert.jdbc.depot.EntityMigration;
import com.samskivert.jdbc.depot.PersistenceContext; import com.samskivert.jdbc.depot.PersistenceContext;
import com.samskivert.jdbc.depot.PersistentRecord; import com.samskivert.jdbc.depot.PersistentRecord;
import com.samskivert.jdbc.depot.clause.Limit; import com.samskivert.jdbc.depot.clause.Limit;
@@ -182,7 +179,7 @@ public class RatingRepository extends DepotRepository
store(record); store(record);
} }
@Override // from DepotRepository @Override
protected void getManagedRecords (Set<Class<? extends PersistentRecord>> classes) protected void getManagedRecords (Set<Class<? extends PersistentRecord>> classes)
{ {
classes.add(RatingRecord.class); classes.add(RatingRecord.class);
@@ -281,9 +281,7 @@ public class Percentiler
return data; return data;
} }
/** @Override
* Generates a string representation of this instance.
*/
public String toString () public String toString ()
{ {
StringBuilder buf = new StringBuilder(); StringBuilder buf = new StringBuilder();
@@ -26,7 +26,6 @@ import com.threerings.parlor.data.ParlorMarshaller;
import com.threerings.parlor.game.data.GameConfig; import com.threerings.parlor.game.data.GameConfig;
import com.threerings.presents.client.InvocationService; import com.threerings.presents.client.InvocationService;
import com.threerings.presents.data.ClientObject; import com.threerings.presents.data.ClientObject;
import com.threerings.presents.data.InvocationMarshaller;
import com.threerings.presents.server.InvocationDispatcher; import com.threerings.presents.server.InvocationDispatcher;
import com.threerings.presents.server.InvocationException; import com.threerings.presents.server.InvocationException;
import com.threerings.util.Name; import com.threerings.util.Name;
@@ -33,12 +33,10 @@ import com.threerings.presents.server.InvocationManager;
import com.threerings.crowd.data.BodyObject; import com.threerings.crowd.data.BodyObject;
import com.threerings.crowd.server.BodyLocator; import com.threerings.crowd.server.BodyLocator;
import com.threerings.crowd.server.CrowdServer;
import com.threerings.crowd.server.PlaceRegistry; import com.threerings.crowd.server.PlaceRegistry;
import com.threerings.parlor.client.ParlorService; import com.threerings.parlor.client.ParlorService;
import com.threerings.parlor.data.ParlorCodes; import com.threerings.parlor.data.ParlorCodes;
import com.threerings.parlor.data.TableConfig;
import com.threerings.parlor.game.data.GameConfig; import com.threerings.parlor.game.data.GameConfig;
import static com.threerings.parlor.Log.log; import static com.threerings.parlor.Log.log;
@@ -37,24 +37,24 @@ public interface ParlorProvider extends InvocationProvider
/** /**
* Handles a {@link ParlorService#cancel} request. * Handles a {@link ParlorService#cancel} request.
*/ */
public void cancel (ClientObject caller, int arg1, InvocationService.InvocationListener arg2) void cancel (ClientObject caller, int arg1, InvocationService.InvocationListener arg2)
throws InvocationException; throws InvocationException;
/** /**
* Handles a {@link ParlorService#invite} request. * Handles a {@link ParlorService#invite} request.
*/ */
public void invite (ClientObject caller, Name arg1, GameConfig arg2, ParlorService.InviteListener arg3) void invite (ClientObject caller, Name arg1, GameConfig arg2, ParlorService.InviteListener arg3)
throws InvocationException; throws InvocationException;
/** /**
* Handles a {@link ParlorService#respond} request. * Handles a {@link ParlorService#respond} request.
*/ */
public void respond (ClientObject caller, int arg1, int arg2, Object arg3, InvocationService.InvocationListener arg4) void respond (ClientObject caller, int arg1, int arg2, Object arg3, InvocationService.InvocationListener arg4)
throws InvocationException; throws InvocationException;
/** /**
* Handles a {@link ParlorService#startSolitaire} request. * Handles a {@link ParlorService#startSolitaire} request.
*/ */
public void startSolitaire (ClientObject caller, GameConfig arg1, InvocationService.ConfirmListener arg2) void startSolitaire (ClientObject caller, GameConfig arg1, InvocationService.ConfirmListener arg2)
throws InvocationException; throws InvocationException;
} }
@@ -25,7 +25,6 @@ import com.threerings.parlor.client.ParlorDecoder;
import com.threerings.parlor.client.ParlorReceiver; import com.threerings.parlor.client.ParlorReceiver;
import com.threerings.parlor.game.data.GameConfig; import com.threerings.parlor.game.data.GameConfig;
import com.threerings.presents.data.ClientObject; import com.threerings.presents.data.ClientObject;
import com.threerings.presents.net.Transport;
import com.threerings.presents.server.InvocationSender; import com.threerings.presents.server.InvocationSender;
import com.threerings.util.Name; import com.threerings.util.Name;
@@ -26,7 +26,6 @@ import com.threerings.parlor.data.TableMarshaller;
import com.threerings.parlor.game.data.GameConfig; import com.threerings.parlor.game.data.GameConfig;
import com.threerings.presents.client.InvocationService; import com.threerings.presents.client.InvocationService;
import com.threerings.presents.data.ClientObject; import com.threerings.presents.data.ClientObject;
import com.threerings.presents.data.InvocationMarshaller;
import com.threerings.presents.server.InvocationDispatcher; import com.threerings.presents.server.InvocationDispatcher;
import com.threerings.presents.server.InvocationException; import com.threerings.presents.server.InvocationException;
@@ -21,15 +21,8 @@
package com.threerings.parlor.server; package com.threerings.parlor.server;
import java.util.HashMap;
import java.util.Iterator;
import com.google.inject.Inject;
import com.samskivert.util.IntMap; import com.samskivert.util.IntMap;
import com.samskivert.util.IntMaps; import com.samskivert.util.IntMaps;
import com.samskivert.util.StringUtil;
import com.threerings.util.Name;
import com.threerings.presents.data.ClientObject; import com.threerings.presents.data.ClientObject;
import com.threerings.presents.dobj.AttributeChangeListener; import com.threerings.presents.dobj.AttributeChangeListener;
import com.threerings.presents.dobj.AttributeChangedEvent; import com.threerings.presents.dobj.AttributeChangedEvent;
@@ -55,7 +48,6 @@ import com.threerings.parlor.data.ParlorCodes;
import com.threerings.parlor.data.Table; import com.threerings.parlor.data.Table;
import com.threerings.parlor.data.TableConfig; import com.threerings.parlor.data.TableConfig;
import com.threerings.parlor.data.TableLobbyObject; import com.threerings.parlor.data.TableLobbyObject;
import com.threerings.parlor.data.TableMarshaller;
import com.threerings.parlor.game.data.GameConfig; import com.threerings.parlor.game.data.GameConfig;
import com.threerings.parlor.game.data.GameObject; import com.threerings.parlor.game.data.GameObject;
import com.threerings.parlor.game.server.GameManager; import com.threerings.parlor.game.server.GameManager;
@@ -36,24 +36,24 @@ public interface TableProvider extends InvocationProvider
/** /**
* Handles a {@link TableService#createTable} request. * Handles a {@link TableService#createTable} request.
*/ */
public void createTable (ClientObject caller, TableConfig arg1, GameConfig arg2, InvocationService.ResultListener arg3) void createTable (ClientObject caller, TableConfig arg1, GameConfig arg2, InvocationService.ResultListener arg3)
throws InvocationException; throws InvocationException;
/** /**
* Handles a {@link TableService#joinTable} request. * Handles a {@link TableService#joinTable} request.
*/ */
public void joinTable (ClientObject caller, int arg1, int arg2, InvocationService.InvocationListener arg3) void joinTable (ClientObject caller, int arg1, int arg2, InvocationService.InvocationListener arg3)
throws InvocationException; throws InvocationException;
/** /**
* Handles a {@link TableService#leaveTable} request. * Handles a {@link TableService#leaveTable} request.
*/ */
public void leaveTable (ClientObject caller, int arg1, InvocationService.InvocationListener arg2) void leaveTable (ClientObject caller, int arg1, InvocationService.InvocationListener arg2)
throws InvocationException; throws InvocationException;
/** /**
* Handles a {@link TableService#startTableNow} request. * Handles a {@link TableService#startTableNow} request.
*/ */
public void startTableNow (ClientObject caller, int arg1, InvocationService.InvocationListener arg2) void startTableNow (ClientObject caller, int arg1, InvocationService.InvocationListener arg2)
throws InvocationException; throws InvocationException;
} }
@@ -23,8 +23,6 @@ package com.threerings.parlor.tourney.client;
import com.threerings.presents.client.Client; import com.threerings.presents.client.Client;
import com.threerings.presents.client.InvocationService; import com.threerings.presents.client.InvocationService;
import com.threerings.presents.client.InvocationService.ConfirmListener;
import com.threerings.presents.client.InvocationService.InvocationListener;
/** /**
* Provides tourney management services for the particular tourney this * Provides tourney management services for the particular tourney this
@@ -49,7 +49,7 @@ public class Participant extends SimpleStreamableObject
return username.compareTo(op.username); return username.compareTo(op.username);
} }
// documentation inherited from interface Comparable @Override
public boolean equals (Object other) public boolean equals (Object other)
{ {
if (other instanceof Participant) { if (other instanceof Participant) {
@@ -58,7 +58,7 @@ public class Participant extends SimpleStreamableObject
return false; return false;
} }
// documentation inherited @Override
public String toString () public String toString ()
{ {
return username.toString(); return username.toString();
@@ -22,7 +22,6 @@
package com.threerings.parlor.tourney.data; package com.threerings.parlor.tourney.data;
import com.threerings.io.SimpleStreamableObject; import com.threerings.io.SimpleStreamableObject;
import com.threerings.presents.dobj.DSet;
import com.threerings.util.Name; import com.threerings.util.Name;
/** /**
@@ -25,7 +25,6 @@ import com.threerings.parlor.tourney.client.TourneyService;
import com.threerings.presents.client.Client; import com.threerings.presents.client.Client;
import com.threerings.presents.client.InvocationService; import com.threerings.presents.client.InvocationService;
import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.data.InvocationMarshaller;
import com.threerings.presents.net.Transport;
/** /**
* Provides the implementation of the {@link TourneyService} interface * Provides the implementation of the {@link TourneyService} interface
@@ -25,7 +25,6 @@ import com.threerings.parlor.tourney.client.TourniesService;
import com.threerings.presents.client.Client; import com.threerings.presents.client.Client;
import com.threerings.presents.client.InvocationService; import com.threerings.presents.client.InvocationService;
import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.data.InvocationMarshaller;
import com.threerings.presents.net.Transport;
/** /**
* Provides the implementation of the {@link TourniesService} interface * Provides the implementation of the {@link TourniesService} interface
@@ -24,7 +24,6 @@ package com.threerings.parlor.tourney.server;
import com.threerings.parlor.tourney.data.TourneyMarshaller; import com.threerings.parlor.tourney.data.TourneyMarshaller;
import com.threerings.presents.client.InvocationService; import com.threerings.presents.client.InvocationService;
import com.threerings.presents.data.ClientObject; import com.threerings.presents.data.ClientObject;
import com.threerings.presents.data.InvocationMarshaller;
import com.threerings.presents.server.InvocationDispatcher; import com.threerings.presents.server.InvocationDispatcher;
import com.threerings.presents.server.InvocationException; import com.threerings.presents.server.InvocationException;
@@ -25,8 +25,6 @@ import com.google.inject.Inject;
import com.samskivert.util.Interval; import com.samskivert.util.Interval;
import com.samskivert.util.ResultListener; import com.samskivert.util.ResultListener;
import com.threerings.util.Name;
import com.threerings.crowd.data.BodyObject; import com.threerings.crowd.data.BodyObject;
import com.threerings.crowd.server.BodyLocator; import com.threerings.crowd.server.BodyLocator;
@@ -262,6 +260,7 @@ public abstract class TourneyManager
// destroy the object in a couple of minutes // destroy the object in a couple of minutes
new Interval(_omgr) { new Interval(_omgr) {
@Override
public void expired () { public void expired () {
_omgr.destroyObject(_trobj.getOid()); _omgr.destroyObject(_trobj.getOid());
} }
@@ -34,18 +34,18 @@ public interface TourneyProvider extends InvocationProvider
/** /**
* Handles a {@link TourneyService#cancel} request. * Handles a {@link TourneyService#cancel} request.
*/ */
public void cancel (ClientObject caller, InvocationService.ConfirmListener arg1) void cancel (ClientObject caller, InvocationService.ConfirmListener arg1)
throws InvocationException; throws InvocationException;
/** /**
* Handles a {@link TourneyService#join} request. * Handles a {@link TourneyService#join} request.
*/ */
public void join (ClientObject caller, InvocationService.ConfirmListener arg1) void join (ClientObject caller, InvocationService.ConfirmListener arg1)
throws InvocationException; throws InvocationException;
/** /**
* Handles a {@link TourneyService#leave} request. * Handles a {@link TourneyService#leave} request.
*/ */
public void leave (ClientObject caller, InvocationService.ConfirmListener arg1) void leave (ClientObject caller, InvocationService.ConfirmListener arg1)
throws InvocationException; throws InvocationException;
} }
@@ -25,7 +25,6 @@ import com.threerings.parlor.tourney.data.TourneyConfig;
import com.threerings.parlor.tourney.data.TourniesMarshaller; import com.threerings.parlor.tourney.data.TourniesMarshaller;
import com.threerings.presents.client.InvocationService; import com.threerings.presents.client.InvocationService;
import com.threerings.presents.data.ClientObject; import com.threerings.presents.data.ClientObject;
import com.threerings.presents.data.InvocationMarshaller;
import com.threerings.presents.server.InvocationDispatcher; import com.threerings.presents.server.InvocationDispatcher;
import com.threerings.presents.server.InvocationException; import com.threerings.presents.server.InvocationException;
@@ -22,7 +22,6 @@
package com.threerings.parlor.tourney.server; package com.threerings.parlor.tourney.server;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List;
import java.util.Map; import java.util.Map;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
@@ -31,18 +30,13 @@ import com.google.inject.Injector;
import com.google.inject.Singleton; import com.google.inject.Singleton;
import com.samskivert.io.PersistenceException; import com.samskivert.io.PersistenceException;
import com.samskivert.jdbc.ConnectionProvider;
import com.samskivert.util.Interval; import com.samskivert.util.Interval;
import com.samskivert.util.RunQueue;
import com.threerings.presents.client.InvocationService; import com.threerings.presents.client.InvocationService;
import com.threerings.presents.data.ClientObject; import com.threerings.presents.data.ClientObject;
import com.threerings.presents.dobj.RootDObjectManager; import com.threerings.presents.dobj.RootDObjectManager;
import com.threerings.presents.server.InvocationException; import com.threerings.presents.server.InvocationException;
import com.threerings.presents.server.PresentsServer;
import com.threerings.presents.server.ShutdownManager; import com.threerings.presents.server.ShutdownManager;
import com.threerings.parlor.tourney.data.Prize;
import com.threerings.parlor.tourney.data.TourneyConfig; import com.threerings.parlor.tourney.data.TourneyConfig;
import com.threerings.parlor.tourney.server.persist.TourneyRepository; import com.threerings.parlor.tourney.server.persist.TourneyRepository;
@@ -63,6 +57,7 @@ public abstract class TourniesManager
_injector = injector; _injector = injector;
_interval = new Interval(_omgr) { _interval = new Interval(_omgr) {
@Override
public void expired () { public void expired () {
updateTournies(); updateTournies();
} }
@@ -35,6 +35,6 @@ public interface TourniesProvider extends InvocationProvider
/** /**
* Handles a {@link TourniesService#createTourney} request. * Handles a {@link TourniesService#createTourney} request.
*/ */
public void createTourney (ClientObject caller, TourneyConfig arg1, InvocationService.ResultListener arg2) void createTourney (ClientObject caller, TourneyConfig arg1, InvocationService.ResultListener arg2)
throws InvocationException; throws InvocationException;
} }
@@ -84,13 +84,13 @@ public class TurnGameControllerDelegate extends GameControllerDelegate
return _gameObj.getPlayerIndex(_turnGame.getTurnHolder()); return _gameObj.getPlayerIndex(_turnGame.getTurnHolder());
} }
// documentation inherited @Override
public void init (CrowdContext ctx, PlaceConfig config) public void init (CrowdContext ctx, PlaceConfig config)
{ {
_ctx = ctx; _ctx = ctx;
} }
// documentation inherited @Override
public void willEnterPlace (PlaceObject plobj) public void willEnterPlace (PlaceObject plobj)
{ {
// get a casted reference to the object // get a casted reference to the object
@@ -102,7 +102,7 @@ public class TurnGameControllerDelegate extends GameControllerDelegate
plobj.addListener(this); plobj.addListener(this);
} }
// documentation inherited @Override
public void didLeavePlace (PlaceObject plobj) public void didLeavePlace (PlaceObject plobj)
{ {
// remove our listenership // remove our listenership
@@ -147,20 +147,20 @@ public class TurnGameManagerDelegate extends GameManagerDelegate
} }
} }
@Override // from PlaceManagerDelegate @Override
public void didInit (PlaceConfig config) public void didInit (PlaceConfig config)
{ {
super.didInit(config); super.didInit(config);
_tgmgr = (TurnGameManager)_plmgr; _tgmgr = (TurnGameManager)_plmgr;
} }
@Override // from PlaceManagerDelegate @Override
public void didStartup (PlaceObject plobj) public void didStartup (PlaceObject plobj)
{ {
_turnGame = (TurnGameObject)plobj; _turnGame = (TurnGameObject)plobj;
} }
// documentation inherited @Override
public void playerWasReplaced (int pidx, Name oplayer, Name nplayer) public void playerWasReplaced (int pidx, Name oplayer, Name nplayer)
{ {
// we need to update the turn holder if the current turn holder was the player that was // we need to update the turn holder if the current turn holder was the player that was
@@ -178,6 +178,7 @@ public class TurnGameManagerDelegate extends GameManagerDelegate
* This should be called from {@link GameManager#gameDidStart} to let the turn delegate perform * This should be called from {@link GameManager#gameDidStart} to let the turn delegate perform
* start of game processing. * start of game processing.
*/ */
@Override
public void gameDidStart () public void gameDidStart ()
{ {
// figure out who will be first // figure out who will be first
@@ -95,7 +95,7 @@ public class RobotPlayer extends Interval
return _active; return _active;
} }
// documentation inherited @Override
public void expired () public void expired ()
{ {
// post a random key press command // post a random key press command
@@ -97,7 +97,7 @@ public class PlayerStatusView extends JPanel
} }
} }
/** Returns a string representation of this instance. */ @Override
public String toString () public String toString ()
{ {
return "[user=" + _username + ", pidx=" + _pidx + return "[user=" + _username + ", pidx=" + _pidx +
@@ -49,7 +49,7 @@ public abstract class PuzzleAnimationWaiter extends AnimationWaiter
return (_puzobj.isInPlay() && (_sessionId == _puzobj.sessionId)); return (_puzobj.isInPlay() && (_sessionId == _puzobj.sessionId));
} }
// documentation inherited @Override
protected final void allAnimationsFinished () protected final void allAnimationsFinished ()
{ {
allAnimationsFinished(puzzleStillValid()); allAnimationsFinished(puzzleStillValid());
@@ -27,13 +27,9 @@ import java.awt.Dimension;
import java.awt.Font; import java.awt.Font;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.awt.Rectangle; import java.awt.Rectangle;
import java.awt.geom.AffineTransform;
import java.util.ArrayList; import java.util.ArrayList;
import javax.swing.UIManager;
import com.samskivert.swing.Label; import com.samskivert.swing.Label;
import com.samskivert.swing.util.SwingUtil;
import com.samskivert.util.StringUtil; import com.samskivert.util.StringUtil;
import com.threerings.media.VirtualMediaPanel; import com.threerings.media.VirtualMediaPanel;
@@ -110,6 +106,7 @@ public abstract class PuzzleBoardView extends VirtualMediaPanel
* If paused, a label will be displayed with the component's font, * If paused, a label will be displayed with the component's font,
* which may be set with setFont(). * which may be set with setFont().
*/ */
@Override
public void setPaused (boolean paused) public void setPaused (boolean paused)
{ {
if (paused) { if (paused) {
@@ -146,7 +143,7 @@ public abstract class PuzzleBoardView extends VirtualMediaPanel
anim.addAnimationObserver(_actionAnimObs); anim.addAnimationObserver(_actionAnimObs);
} }
// documentation inherited @Override
public void abortAnimation (Animation anim) public void abortAnimation (Animation anim)
{ {
super.abortAnimation(anim); super.abortAnimation(anim);
@@ -187,9 +184,7 @@ public abstract class PuzzleBoardView extends VirtualMediaPanel
_actionSprites.add(sprite); _actionSprites.add(sprite);
} }
/** @Override
* Removes the given sprite from the board.
*/
public void removeSprite (Sprite sprite) public void removeSprite (Sprite sprite)
{ {
super.removeSprite(sprite); super.removeSprite(sprite);
@@ -205,14 +200,14 @@ public abstract class PuzzleBoardView extends VirtualMediaPanel
} }
} }
// documentation inherited @Override
public void clearSprites () public void clearSprites ()
{ {
super.clearSprites(); super.clearSprites();
_actionSprites.clear(); _actionSprites.clear();
} }
// documentation inherited @Override
public void clearAnimations () public void clearAnimations ()
{ {
super.clearAnimations(); super.clearAnimations();
@@ -250,6 +245,7 @@ public abstract class PuzzleBoardView extends VirtualMediaPanel
public void dumpActors () public void dumpActors ()
{ {
StringUtil.Formatter fmt = new StringUtil.Formatter() { StringUtil.Formatter fmt = new StringUtil.Formatter() {
@Override
public String toString (Object obj) { public String toString (Object obj) {
return StringUtil.shortClassName(obj); return StringUtil.shortClassName(obj);
} }
@@ -302,7 +298,7 @@ public abstract class PuzzleBoardView extends VirtualMediaPanel
_avoidArranger.positionAvoidAnimation(anim, _vbounds); _avoidArranger.positionAvoidAnimation(anim, _vbounds);
} }
// documentation inherited @Override
public void paintBehind (Graphics2D gfx, Rectangle dirty) public void paintBehind (Graphics2D gfx, Rectangle dirty)
{ {
super.paintBehind(gfx, dirty); super.paintBehind(gfx, dirty);
@@ -320,7 +316,7 @@ public abstract class PuzzleBoardView extends VirtualMediaPanel
gfx.fill(dirty); gfx.fill(dirty);
} }
// documentation inherited @Override
public void paintBetween (Graphics2D gfx, Rectangle dirty) public void paintBetween (Graphics2D gfx, Rectangle dirty)
{ {
super.paintBetween(gfx, dirty); super.paintBetween(gfx, dirty);
@@ -328,7 +324,7 @@ public abstract class PuzzleBoardView extends VirtualMediaPanel
renderBoard(gfx, dirty); renderBoard(gfx, dirty);
} }
// documentation inherited @Override
protected void paintInFront (Graphics2D gfx, Rectangle dirty) protected void paintInFront (Graphics2D gfx, Rectangle dirty)
{ {
super.paintInFront(gfx, dirty); super.paintInFront(gfx, dirty);
@@ -404,6 +400,7 @@ public abstract class PuzzleBoardView extends VirtualMediaPanel
/** Listens to our action animations and clears them when they're done. */ /** Listens to our action animations and clears them when they're done. */
protected AnimationAdapter _actionAnimObs = new AnimationAdapter() { protected AnimationAdapter _actionAnimObs = new AnimationAdapter() {
@Override
public void animationCompleted (Animation anim, long when) { public void animationCompleted (Animation anim, long when) {
animationFinished(anim); animationFinished(anim);
} }
@@ -36,8 +36,6 @@ import com.samskivert.swing.util.MouseHijacker;
import com.samskivert.util.CollectionUtil; import com.samskivert.util.CollectionUtil;
import com.samskivert.util.ObserverList; import com.samskivert.util.ObserverList;
import com.samskivert.util.StringUtil;
import com.threerings.media.FrameParticipant; import com.threerings.media.FrameParticipant;
import com.threerings.presents.dobj.AttributeChangeListener; import com.threerings.presents.dobj.AttributeChangeListener;
@@ -88,7 +86,7 @@ public abstract class PuzzleController extends GameController
public int actionCleared (); public int actionCleared ();
} }
// documentation inherited @Override
protected void didInit () protected void didInit ()
{ {
super.didInit(); super.didInit();
@@ -125,7 +123,7 @@ public abstract class PuzzleController extends GameController
return _pidx; return _pidx;
} }
// documentation inherited @Override
public void setGameOver (boolean gameOver) public void setGameOver (boolean gameOver)
{ {
super.setGameOver(gameOver); super.setGameOver(gameOver);
@@ -182,6 +180,7 @@ public abstract class PuzzleController extends GameController
// dispatch the change to our delegates // dispatch the change to our delegates
applyToDelegates(new DelegateOp(PuzzleControllerDelegate.class) { applyToDelegates(new DelegateOp(PuzzleControllerDelegate.class) {
@Override
public void apply (PlaceControllerDelegate delegate) { public void apply (PlaceControllerDelegate delegate) {
((PuzzleControllerDelegate)delegate).setChatting(_chatting); ((PuzzleControllerDelegate)delegate).setChatting(_chatting);
} }
@@ -226,6 +225,7 @@ public abstract class PuzzleController extends GameController
// check with the delegates // check with the delegates
final boolean[] canChatNow = new boolean[] { true }; final boolean[] canChatNow = new boolean[] { true };
applyToDelegates(new DelegateOp(PuzzleControllerDelegate.class) { applyToDelegates(new DelegateOp(PuzzleControllerDelegate.class) {
@Override
public void apply (PlaceControllerDelegate delegate) { public void apply (PlaceControllerDelegate delegate) {
canChatNow[0] = canChatNow[0] =
((PuzzleControllerDelegate)delegate).canStartChatting() && ((PuzzleControllerDelegate)delegate).canStartChatting() &&
@@ -244,7 +244,7 @@ public abstract class PuzzleController extends GameController
return _chatting; return _chatting;
} }
// documentation inherited @Override
public void willEnterPlace (PlaceObject plobj) public void willEnterPlace (PlaceObject plobj)
{ {
super.willEnterPlace(plobj); super.willEnterPlace(plobj);
@@ -269,7 +269,7 @@ public abstract class PuzzleController extends GameController
} }
} }
// documentation inherited @Override
public void mayLeavePlace (PlaceObject plobj) public void mayLeavePlace (PlaceObject plobj)
{ {
super.mayLeavePlace(plobj); super.mayLeavePlace(plobj);
@@ -278,7 +278,7 @@ public abstract class PuzzleController extends GameController
sendProgressUpdate(); sendProgressUpdate();
} }
// documentation inherited @Override
public void didLeavePlace (PlaceObject plobj) public void didLeavePlace (PlaceObject plobj)
{ {
super.didLeavePlace(plobj); super.didLeavePlace(plobj);
@@ -319,7 +319,7 @@ public abstract class PuzzleController extends GameController
return true; return true;
} }
// documentation inherited @Override
public void attributeChanged (AttributeChangedEvent event) public void attributeChanged (AttributeChangedEvent event)
{ {
String name = event.getName(); String name = event.getName();
@@ -370,7 +370,7 @@ public abstract class PuzzleController extends GameController
} }
} }
// documentation inherited @Override
protected void gameWillReset () protected void gameWillReset ()
{ {
super.gameWillReset(); super.gameWillReset();
@@ -449,6 +449,7 @@ public abstract class PuzzleController extends GameController
// let our delegates do their business // let our delegates do their business
applyToDelegates(new DelegateOp(PuzzleControllerDelegate.class) { applyToDelegates(new DelegateOp(PuzzleControllerDelegate.class) {
@Override
public void apply (PlaceControllerDelegate delegate) { public void apply (PlaceControllerDelegate delegate) {
((PuzzleControllerDelegate)delegate).startAction(); ((PuzzleControllerDelegate)delegate).startAction();
} }
@@ -559,6 +560,7 @@ public abstract class PuzzleController extends GameController
// let our delegates do their business // let our delegates do their business
applyToDelegates(new DelegateOp(PuzzleControllerDelegate.class) { applyToDelegates(new DelegateOp(PuzzleControllerDelegate.class) {
@Override
public void apply (PlaceControllerDelegate delegate) { public void apply (PlaceControllerDelegate delegate) {
canClear[0] = canClear[0] && canClear[0] = canClear[0] &&
((PuzzleControllerDelegate)delegate).canClearAction(); ((PuzzleControllerDelegate)delegate).canClearAction();
@@ -601,6 +603,7 @@ public abstract class PuzzleController extends GameController
// let our delegates do their business // let our delegates do their business
applyToDelegates(new DelegateOp(PuzzleControllerDelegate.class) { applyToDelegates(new DelegateOp(PuzzleControllerDelegate.class) {
@Override
public void apply (PlaceControllerDelegate delegate) { public void apply (PlaceControllerDelegate delegate) {
((PuzzleControllerDelegate)delegate).clearAction(); ((PuzzleControllerDelegate)delegate).clearAction();
} }
@@ -648,7 +651,7 @@ public abstract class PuzzleController extends GameController
{ {
} }
// documentation inherited @Override
public boolean handleAction (ActionEvent action) public boolean handleAction (ActionEvent action)
{ {
String cmd = action.getActionCommand(); String cmd = action.getActionCommand();
@@ -695,6 +698,7 @@ public abstract class PuzzleController extends GameController
// let our delegates do their business // let our delegates do their business
applyToDelegates(new DelegateOp(PuzzleControllerDelegate.class) { applyToDelegates(new DelegateOp(PuzzleControllerDelegate.class) {
@Override
public void apply (PlaceControllerDelegate delegate) { public void apply (PlaceControllerDelegate delegate) {
((PuzzleControllerDelegate)delegate).setBoard(_pboard); ((PuzzleControllerDelegate)delegate).setBoard(_pboard);
} }
@@ -796,6 +800,7 @@ public abstract class PuzzleController extends GameController
{ {
// dispatch this to our delegates // dispatch this to our delegates
applyToDelegates(new DelegateOp(PuzzleControllerDelegate.class) { applyToDelegates(new DelegateOp(PuzzleControllerDelegate.class) {
@Override
public void apply (PlaceControllerDelegate delegate) { public void apply (PlaceControllerDelegate delegate) {
((PuzzleControllerDelegate)delegate).playerKnockedOut(pidx); ((PuzzleControllerDelegate)delegate).playerKnockedOut(pidx);
} }
@@ -816,6 +821,7 @@ public abstract class PuzzleController extends GameController
panel.getBoardView().addMouseListener(_clicker); panel.getBoardView().addMouseListener(_clicker);
} }
@Override
public Component release () public Component release ()
{ {
_panel.removeMouseListener(_clicker); _panel.removeMouseListener(_clicker);
@@ -824,6 +830,7 @@ public abstract class PuzzleController extends GameController
} }
protected MouseAdapter _clicker = new MouseAdapter() { protected MouseAdapter _clicker = new MouseAdapter() {
@Override
public void mousePressed (MouseEvent event) { public void mousePressed (MouseEvent event) {
setChatting(false); // this will call release setChatting(false); // this will call release
} }
@@ -938,6 +945,7 @@ public abstract class PuzzleController extends GameController
/** A key listener that currently just toggles pause in the puzzle. */ /** A key listener that currently just toggles pause in the puzzle. */
protected KeyListener _globalKeyListener = new KeyAdapter() { protected KeyListener _globalKeyListener = new KeyAdapter() {
@Override
public void keyReleased (KeyEvent e) public void keyReleased (KeyEvent e)
{ {
int keycode = e.getKeyCode(); int keycode = e.getKeyCode();
@@ -50,7 +50,7 @@ public class PuzzleControllerDelegate extends GameControllerDelegate
_ctrl = ctrl; _ctrl = ctrl;
} }
// documentation inherited @Override
public void willEnterPlace (PlaceObject plobj) public void willEnterPlace (PlaceObject plobj)
{ {
super.willEnterPlace(plobj); super.willEnterPlace(plobj);
@@ -59,7 +59,7 @@ public class PuzzleControllerDelegate extends GameControllerDelegate
_puzobj = (PuzzleObject)plobj; _puzobj = (PuzzleObject)plobj;
} }
// documentation inherited @Override
public void didLeavePlace (PlaceObject plobj) public void didLeavePlace (PlaceObject plobj)
{ {
super.didLeavePlace(plobj); super.didLeavePlace(plobj);
@@ -77,7 +77,7 @@ public abstract class PuzzlePanel extends JPanel
add(_bpanel, BorderLayout.CENTER); add(_bpanel, BorderLayout.CENTER);
} }
// documentation inherited @Override
public void addNotify () public void addNotify ()
{ {
super.addNotify(); super.addNotify();
@@ -87,7 +87,7 @@ public abstract class PuzzlePanel extends JPanel
setPuzzleGrabsKeys(false); setPuzzleGrabsKeys(false);
} }
// documentation inherited @Override
public void removeNotify () public void removeNotify ()
{ {
super.removeNotify(); super.removeNotify();
@@ -47,7 +47,7 @@ public abstract class Board
*/ */
public abstract boolean equals (Board other); public abstract boolean equals (Board other);
// documentation inherited @Override
public Object clone () public Object clone ()
{ {
try { try {
@@ -96,13 +96,13 @@ public abstract class Board
setSeed(seed); setSeed(seed);
} }
// documentation inherited @Override
public synchronized void setSeed (long seed) public synchronized void setSeed (long seed)
{ {
_seed = (seed ^ multiplier) & mask; _seed = (seed ^ multiplier) & mask;
} }
// documentation inherited @Override
synchronized protected int next (int bits) synchronized protected int next (int bits)
{ {
long nextseed = (_seed * multiplier + addend) & mask; long nextseed = (_seed * multiplier + addend) & mask;
@@ -110,7 +110,7 @@ public abstract class Board
return (int)(nextseed >>> (48 - bits)); return (int)(nextseed >>> (48 - bits));
} }
// documentation inherited @Override
public void nextBytes (byte[] bytes) public void nextBytes (byte[] bytes)
{ {
unimplemented(); unimplemented();
@@ -122,7 +122,7 @@ public abstract class Board
// nextBoolean() // nextBoolean()
// nextFloat() // nextFloat()
// documentation inherited @Override
public int nextInt (int n) public int nextInt (int n)
{ {
if (n <= 0) { if (n <= 0) {
@@ -141,14 +141,14 @@ public abstract class Board
return val; return val;
} }
// documentation inherited @Override
public double nextDouble () public double nextDouble ()
{ {
long l = ((long)(next(26)) << 27) + next(27); long l = ((long)(next(26)) << 27) + next(27);
return l / (double)(1L << 53); return l / (double)(1L << 53);
} }
// documentation inherited @Override
public synchronized double nextGaussian () public synchronized double nextGaussian ()
{ {
if (_haveNextNextGaussian) { if (_haveNextNextGaussian) {
@@ -169,7 +169,7 @@ public abstract class Board
} }
} }
// documentation inherited @Override
public Object clone () public Object clone ()
{ {
try { try {
@@ -23,7 +23,6 @@ package com.threerings.puzzle.data;
import com.threerings.presents.client.Client; import com.threerings.presents.client.Client;
import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.data.InvocationMarshaller;
import com.threerings.presents.net.Transport;
import com.threerings.puzzle.client.PuzzleGameService; import com.threerings.puzzle.client.PuzzleGameService;
/** /**
@@ -68,7 +68,7 @@ public class DropBlockSprite extends DropSprite
_orient = orient; _orient = orient;
} }
// documentation inherited @Override
protected void init () protected void init ()
{ {
super.init(); super.init();
@@ -124,21 +124,21 @@ public class DropBlockSprite extends DropSprite
return _ecol; return _ecol;
} }
// documentation inherited @Override
public void setColumn (int col) public void setColumn (int col)
{ {
super.setColumn(col); super.setColumn(col);
updateDropInfo(); updateDropInfo();
} }
// documentation inherited @Override
public void setRow (int row) public void setRow (int row)
{ {
super.setRow(row); super.setRow(row);
updateDropInfo(); updateDropInfo();
} }
// documentation inherited @Override
public void setBoardLocation (int row, int col) public void setBoardLocation (int row, int col)
{ {
super.setBoardLocation(row, col); super.setBoardLocation(row, col);
@@ -149,6 +149,7 @@ public class DropBlockSprite extends DropSprite
* Updates the sprite image offset to reflect the direction in which * Updates the sprite image offset to reflect the direction in which
* the external piece is hanging. * the external piece is hanging.
*/ */
@Override
public void setOrientation (int orient) public void setOrientation (int orient)
{ {
super.setOrientation(orient); super.setOrientation(orient);
@@ -168,7 +169,7 @@ public class DropBlockSprite extends DropSprite
updateDropInfo(); updateDropInfo();
} }
// documentation inherited @Override
public void toString (StringBuilder buf) public void toString (StringBuilder buf)
{ {
super.toString(buf); super.toString(buf);
@@ -81,6 +81,7 @@ public abstract class DropBoardView extends PuzzleBoardView
/** /**
* Initializes the board with the board dimensions. * Initializes the board with the board dimensions.
*/ */
@Override
public void init (GameConfig config) public void init (GameConfig config)
{ {
DropConfig dconfig = (DropConfig)config; DropConfig dconfig = (DropConfig)config;
@@ -265,6 +266,7 @@ public abstract class DropBoardView extends PuzzleBoardView
Point end = new Point(); Point end = new Point();
getPiecePosition(tx, ty, end); getPiecePosition(tx, ty, end);
piece.addSpriteObserver(new PathAdapter() { piece.addSpriteObserver(new PathAdapter() {
@Override
public void pathCompleted (Sprite sprite, Path path, long when) { public void pathCompleted (Sprite sprite, Path path, long when) {
sprite.removeSpriteObserver(this); sprite.removeSpriteObserver(this);
if (_pieces[tpos] != null) { if (_pieces[tpos] != null) {
@@ -323,7 +325,7 @@ public abstract class DropBoardView extends PuzzleBoardView
public abstract Mirage getPieceImage ( public abstract Mirage getPieceImage (
int piece, int col, int row, int orient); int piece, int col, int row, int orient);
// documentation inherited @Override
public void setBoard (Board board) public void setBoard (Board board)
{ {
// when a new board arrives, we want to remove all drop sprites // when a new board arrives, we want to remove all drop sprites
@@ -525,7 +527,7 @@ public abstract class DropBoardView extends PuzzleBoardView
// nothing for now // nothing for now
} }
// documentation inherited @Override
public void paintBetween (Graphics2D gfx, Rectangle dirtyRect) public void paintBetween (Graphics2D gfx, Rectangle dirtyRect)
{ {
gfx.translate(0, -_roff); gfx.translate(0, -_roff);
@@ -534,7 +536,7 @@ public abstract class DropBoardView extends PuzzleBoardView
gfx.translate(0, _roff); gfx.translate(0, _roff);
} }
// documentation inherited @Override
public Dimension getPreferredSize () public Dimension getPreferredSize ()
{ {
int wid = _bwid * _pwid; int wid = _bwid * _pwid;
@@ -26,8 +26,6 @@ import java.awt.Point;
import java.awt.Rectangle; import java.awt.Rectangle;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.util.List;
import com.samskivert.util.IntListUtil; import com.samskivert.util.IntListUtil;
import com.threerings.media.FrameParticipant; import com.threerings.media.FrameParticipant;
@@ -51,7 +49,6 @@ import com.threerings.puzzle.drop.data.DropConfig;
import com.threerings.puzzle.drop.data.DropLogic; import com.threerings.puzzle.drop.data.DropLogic;
import com.threerings.puzzle.drop.data.DropPieceCodes; import com.threerings.puzzle.drop.data.DropPieceCodes;
import com.threerings.puzzle.drop.util.PieceDropLogic; import com.threerings.puzzle.drop.util.PieceDropLogic;
import com.threerings.puzzle.drop.util.PieceDropper.PieceDropInfo;
import com.threerings.puzzle.drop.util.PieceDropper; import com.threerings.puzzle.drop.util.PieceDropper;
import static com.threerings.puzzle.Log.log; import static com.threerings.puzzle.Log.log;
@@ -124,7 +121,7 @@ public abstract class DropControllerDelegate extends PuzzleControllerDelegate
} }
} }
// documentation inherited @Override
public void init (CrowdContext ctx, PlaceConfig config) public void init (CrowdContext ctx, PlaceConfig config)
{ {
super.init(ctx, config); super.init(ctx, config);
@@ -169,6 +166,7 @@ public abstract class DropControllerDelegate extends PuzzleControllerDelegate
/** /**
* Starts up the action; tries evolving the board to get things going. * Starts up the action; tries evolving the board to get things going.
*/ */
@Override
protected void startAction () protected void startAction ()
{ {
super.startAction(); super.startAction();
@@ -207,7 +205,7 @@ public abstract class DropControllerDelegate extends PuzzleControllerDelegate
unstabilizeBoard(); unstabilizeBoard();
} }
// documentation inherited @Override
protected boolean canClearAction () protected boolean canClearAction ()
{ {
if (!_stable) { if (!_stable) {
@@ -221,6 +219,7 @@ public abstract class DropControllerDelegate extends PuzzleControllerDelegate
* sprites, any pieces rising in the board, and resets the animation * sprites, any pieces rising in the board, and resets the animation
* timestamps. * timestamps.
*/ */
@Override
protected void clearAction () protected void clearAction ()
{ {
super.clearAction(); super.clearAction();
@@ -246,7 +245,7 @@ public abstract class DropControllerDelegate extends PuzzleControllerDelegate
_ctx.getFrameManager().removeFrameParticipant(this); _ctx.getFrameManager().removeFrameParticipant(this);
} }
// documentation inherited @Override
public void gameDidEnd () public void gameDidEnd ()
{ {
super.gameDidEnd(); super.gameDidEnd();
@@ -259,7 +258,7 @@ public abstract class DropControllerDelegate extends PuzzleControllerDelegate
// _dview.setRisingPieces(null); // _dview.setRisingPieces(null);
} }
// documentation inherited @Override
public boolean handleAction (ActionEvent action) public boolean handleAction (ActionEvent action)
{ {
// handle any block-related movement actions // handle any block-related movement actions
@@ -281,7 +280,7 @@ public abstract class DropControllerDelegate extends PuzzleControllerDelegate
return true; return true;
} }
// documentation inherited @Override
public void setBoard (Board board) public void setBoard (Board board)
{ {
super.setBoard(board); super.setBoard(board);
@@ -1183,6 +1182,7 @@ public abstract class DropControllerDelegate extends PuzzleControllerDelegate
/** Used to evolve the board following the completion of animations. */ /** Used to evolve the board following the completion of animations. */
protected AnimationAdapter _evolveObserver = new AnimationAdapter() { protected AnimationAdapter _evolveObserver = new AnimationAdapter() {
@Override
public void animationCompleted (Animation anim, long when) { public void animationCompleted (Animation anim, long when) {
animationDidFinish(anim); animationDidFinish(anim);
} }
@@ -32,8 +32,6 @@ import com.threerings.util.DirectionUtil;
import com.threerings.media.image.Mirage; import com.threerings.media.image.Mirage;
import com.threerings.media.sprite.Sprite; import com.threerings.media.sprite.Sprite;
import static com.threerings.puzzle.Log.log;
/** /**
* The drop sprite is a sprite that displays one or more pieces falling * The drop sprite is a sprite that displays one or more pieces falling
* toward the bottom of the board. * toward the bottom of the board.
@@ -79,7 +77,7 @@ public class DropSprite extends Sprite
setRenderOrder(renderOrder); setRenderOrder(renderOrder);
} }
// documentation inherited @Override
protected void init () protected void init ()
{ {
super.init(); super.init();
@@ -304,7 +302,7 @@ public class DropSprite extends Sprite
setLocation(_ox, _srcPos.y+1); setLocation(_ox, _srcPos.y+1);
} }
// documentation inherited @Override
public boolean inside (Shape shape) public boolean inside (Shape shape)
{ {
return shape.contains(_bounds); return shape.contains(_bounds);
@@ -336,7 +334,7 @@ public class DropSprite extends Sprite
return pctdone; return pctdone;
} }
// documentation inherited @Override
public void paint (Graphics2D gfx) public void paint (Graphics2D gfx)
{ {
// get the column and row increment based on the sprite's orientation // get the column and row increment based on the sprite's orientation
@@ -370,7 +368,7 @@ public class DropSprite extends Sprite
image.paint(gfx, x, y); image.paint(gfx, x, y);
} }
// documentation inherited @Override
public void tick (long timestamp) public void tick (long timestamp)
{ {
super.tick(timestamp); super.tick(timestamp);
@@ -440,7 +438,7 @@ public class DropSprite extends Sprite
// Log.info("Moved to row " + _row); // Log.info("Moved to row " + _row);
} }
// documentation inherited @Override
public void fastForward (long timeDelta) public void fastForward (long timeDelta)
{ {
if (_rowstamp > 0) { if (_rowstamp > 0) {
@@ -448,7 +446,7 @@ public class DropSprite extends Sprite
} }
} }
// documentation inherited @Override
public void toString (StringBuilder buf) public void toString (StringBuilder buf)
{ {
super.toString(buf); super.toString(buf);
@@ -470,7 +468,7 @@ public class DropSprite extends Sprite
setLocation(_srcPos.x, _srcPos.y); setLocation(_srcPos.x, _srcPos.y);
} }
// documentation inherited @Override
public void setOrientation (int orient) public void setOrientation (int orient)
{ {
invalidate(); invalidate();
@@ -61,7 +61,7 @@ public class NextBlockView extends JComponent
repaint(); repaint();
} }
// documentation inherited @Override
public void paintComponent (Graphics g) public void paintComponent (Graphics g)
{ {
super.paintComponent(g); super.paintComponent(g);
@@ -85,7 +85,7 @@ public class NextBlockView extends JComponent
} }
} }
// documentation inherited @Override
public Dimension getPreferredSize () public Dimension getPreferredSize ()
{ {
int wid = (_orient == VERTICAL) ? _pwid : (2 * _pwid); int wid = (_orient == VERTICAL) ? _pwid : (2 * _pwid);
@@ -25,13 +25,11 @@ import java.awt.Graphics2D;
import java.awt.Rectangle; import java.awt.Rectangle;
import com.threerings.media.animation.Animation; import com.threerings.media.animation.Animation;
import com.threerings.media.sprite.ImageSprite;
import com.threerings.media.sprite.PathObserver; import com.threerings.media.sprite.PathObserver;
import com.threerings.media.sprite.Sprite; import com.threerings.media.sprite.Sprite;
import com.threerings.media.util.Path; import com.threerings.media.util.Path;
import com.threerings.puzzle.drop.data.DropBoard; import com.threerings.puzzle.drop.data.DropBoard;
import com.threerings.puzzle.drop.data.DropPieceCodes;
/** /**
* Animates all the pieces on a puzzle board doing some sort of global * Animates all the pieces on a puzzle board doing some sort of global
@@ -51,13 +49,13 @@ public abstract class PieceGroupAnimation extends Animation
_board = board; _board = board;
} }
// documentation inherited @Override
public void tick (long tickStamp) public void tick (long tickStamp)
{ {
// nothing doing // nothing doing
} }
// documentation inherited @Override
public void paint (Graphics2D gfx) public void paint (Graphics2D gfx)
{ {
// nothing doing // nothing doing
@@ -75,7 +73,7 @@ public abstract class PieceGroupAnimation extends Animation
_finished = (--_penders == 0); _finished = (--_penders == 0);
} }
// documentation inherited @Override
protected void willStart (long tickStamp) protected void willStart (long tickStamp)
{ {
super.willStart(tickStamp); super.willStart(tickStamp);
@@ -27,8 +27,6 @@ import java.util.Arrays;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import com.threerings.util.DirectionUtil;
import com.threerings.puzzle.data.Board; import com.threerings.puzzle.data.Board;
import com.threerings.puzzle.drop.client.DropControllerDelegate; import com.threerings.puzzle.drop.client.DropControllerDelegate;
import com.threerings.puzzle.drop.util.DropBoardUtil; import com.threerings.puzzle.drop.util.DropBoardUtil;
@@ -534,13 +532,13 @@ public class DropBoard extends Board
op.execute(this, col, row); op.execute(this, col, row);
} }
// documentation inherited from interface @Override
public void dump () public void dump ()
{ {
dumpAndCompare(null); dumpAndCompare(null);
} }
// documentation inherited from interface @Override
public void dumpAndCompare (Board other) public void dumpAndCompare (Board other)
{ {
if (other != null && !(other instanceof DropBoard)) { if (other != null && !(other instanceof DropBoard)) {
@@ -571,7 +569,7 @@ public class DropBoard extends Board
} }
} }
/** Returns a string representation of this instance. */ @Override
public String toString () public String toString ()
{ {
StringBuilder buf = new StringBuilder(); StringBuilder buf = new StringBuilder();
@@ -580,7 +578,7 @@ public class DropBoard extends Board
return buf.append("]").toString(); return buf.append("]").toString();
} }
// documentation inherited from interface @Override
public boolean equals (Board other) public boolean equals (Board other)
{ {
// make sure we're comparing the same class type // make sure we're comparing the same class type
@@ -694,7 +692,7 @@ public class DropBoard extends Board
_board = board; _board = board;
} }
// documentation inherited @Override
public Object clone () public Object clone ()
{ {
DropBoard board = (DropBoard)super.clone(); DropBoard board = (DropBoard)super.clone();
@@ -66,7 +66,7 @@ public class DropBoardSummary extends BoardSummary
return idx; return idx;
} }
// documentation inherited @Override
public void setBoard (Board board) public void setBoard (Board board)
{ {
_dboard = (DropBoard)board; _dboard = (DropBoard)board;
@@ -76,7 +76,7 @@ public class DropBoardSummary extends BoardSummary
super.setBoard(board); super.setBoard(board);
} }
// documentation inherited @Override
public void summarize () public void summarize ()
{ {
// update the board column levels // update the board column levels
@@ -50,9 +50,7 @@ public class SegmentInfo
this.len = len; this.len = len;
} }
/** @Override
* Returns a string representation of this instance.
*/
public String toString () public String toString ()
{ {
return StringUtil.fieldsToString(this); return StringUtil.fieldsToString(this);
@@ -89,7 +89,7 @@ public abstract class DropManagerDelegate extends PuzzleManagerDelegate
} }
} }
// documentation inherited @Override
public void didInit (PlaceConfig config) public void didInit (PlaceConfig config)
{ {
_dconfig = (DropConfig)config; _dconfig = (DropConfig)config;
@@ -101,7 +101,7 @@ public abstract class DropManagerDelegate extends PuzzleManagerDelegate
super.didInit(config); super.didInit(config);
} }
// documentation inherited @Override
public void didStartup (PlaceObject plobj) public void didStartup (PlaceObject plobj)
{ {
super.didStartup(plobj); super.didStartup(plobj);
@@ -116,7 +116,7 @@ public abstract class DropManagerDelegate extends PuzzleManagerDelegate
} }
} }
// documentation inherited @Override
public void gameWillStart () public void gameWillStart ()
{ {
super.gameWillStart(); super.gameWillStart();
@@ -21,10 +21,6 @@
package com.threerings.puzzle.drop.util; package com.threerings.puzzle.drop.util;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.samskivert.util.StringUtil; import com.samskivert.util.StringUtil;
import com.threerings.puzzle.drop.data.DropBoard; import com.threerings.puzzle.drop.data.DropBoard;
@@ -65,7 +61,7 @@ public class PieceDropper
this.dist = dist; this.dist = dist;
} }
/** Returns a string representation of this instance. */ @Override
public String toString () public String toString ()
{ {
return StringUtil.fieldsToString(this); return StringUtil.fieldsToString(this);
@@ -22,7 +22,6 @@
package com.threerings.puzzle.server; package com.threerings.puzzle.server;
import com.threerings.presents.data.ClientObject; import com.threerings.presents.data.ClientObject;
import com.threerings.presents.data.InvocationMarshaller;
import com.threerings.presents.server.InvocationDispatcher; import com.threerings.presents.server.InvocationDispatcher;
import com.threerings.presents.server.InvocationException; import com.threerings.presents.server.InvocationException;
import com.threerings.puzzle.data.Board; import com.threerings.puzzle.data.Board;
@@ -33,10 +33,10 @@ public interface PuzzleGameProvider extends InvocationProvider
/** /**
* Handles a {@link PuzzleGameService#updateProgress} request. * Handles a {@link PuzzleGameService#updateProgress} request.
*/ */
public void updateProgress (ClientObject caller, int arg1, int[] arg2); void updateProgress (ClientObject caller, int arg1, int[] arg2);
/** /**
* Handles a {@link PuzzleGameService#updateProgressSync} request. * Handles a {@link PuzzleGameService#updateProgressSync} request.
*/ */
public void updateProgressSync (ClientObject caller, int arg1, int[] arg2, Board[] arg3); void updateProgressSync (ClientObject caller, int arg1, int[] arg2, Board[] arg3);
} }
@@ -28,18 +28,8 @@ import com.samskivert.util.Interval;
import com.samskivert.util.RandomUtil; import com.samskivert.util.RandomUtil;
import com.threerings.presents.data.ClientObject; import com.threerings.presents.data.ClientObject;
import com.threerings.presents.dobj.DObject;
import com.threerings.presents.dobj.OidList;
import com.threerings.crowd.data.BodyObject;
import com.threerings.crowd.data.PlaceObject;
import com.threerings.parlor.game.data.GameObject;
import com.threerings.parlor.game.server.GameManager; import com.threerings.parlor.game.server.GameManager;
import com.threerings.util.MessageBundle;
import com.threerings.util.Name;
import com.threerings.puzzle.data.Board; import com.threerings.puzzle.data.Board;
import com.threerings.puzzle.data.BoardSummary; import com.threerings.puzzle.data.BoardSummary;
import com.threerings.puzzle.data.PuzzleCodes; import com.threerings.puzzle.data.PuzzleCodes;
@@ -127,7 +117,7 @@ public abstract class PuzzleManager extends GameManager
} }
} }
// documentation inherited @Override
protected void playerGameDidEnd (int pidx) protected void playerGameDidEnd (int pidx)
{ {
super.playerGameDidEnd(pidx); super.playerGameDidEnd(pidx);
@@ -158,7 +148,7 @@ public abstract class PuzzleManager extends GameManager
return false; return false;
} }
// documentation inherited @Override
protected void didStartup () protected void didStartup ()
{ {
super.didStartup(); super.didStartup();
@@ -170,7 +160,7 @@ public abstract class PuzzleManager extends GameManager
_puzobj.setPuzzleGameService(_invmgr.registerDispatcher(new PuzzleGameDispatcher(this))); _puzobj.setPuzzleGameService(_invmgr.registerDispatcher(new PuzzleGameDispatcher(this)));
} }
// documentation inherited @Override
protected void gameWillStart () protected void gameWillStart ()
{ {
int size = getPlayerSlots(); int size = getPlayerSlots();
@@ -205,6 +195,7 @@ public abstract class PuzzleManager extends GameManager
if (_statusInterval == null && statusInterval > 0) { if (_statusInterval == null && statusInterval > 0) {
// register the status update interval to address subsequent periodic updates // register the status update interval to address subsequent periodic updates
_statusInterval = new Interval(_omgr) { _statusInterval = new Interval(_omgr) {
@Override
public void expired () { public void expired () {
sendStatusUpdate(); sendStatusUpdate();
} }
@@ -236,7 +227,7 @@ public abstract class PuzzleManager extends GameManager
return DEFAULT_DIFFICULTY; return DEFAULT_DIFFICULTY;
} }
// documentation inherited @Override
protected void gameDidStart () protected void gameDidStart ()
{ {
super.gameDidStart(); super.gameDidStart();
@@ -332,7 +323,7 @@ public abstract class PuzzleManager extends GameManager
return (_puzobj.isOccupiedPlayer(pidx)); return (_puzobj.isOccupiedPlayer(pidx));
} }
// documentation inherited @Override
protected void gameDidEnd () protected void gameDidEnd ()
{ {
if (_statusInterval != null) { if (_statusInterval != null) {
@@ -347,7 +338,7 @@ public abstract class PuzzleManager extends GameManager
super.gameDidEnd(); super.gameDidEnd();
} }
// documentation inherited @Override
protected void didShutdown () protected void didShutdown ()
{ {
super.didShutdown(); super.didShutdown();
@@ -452,6 +443,7 @@ public abstract class PuzzleManager extends GameManager
* Overrides the game manager implementation to mark all active players as winners. Derived * Overrides the game manager implementation to mark all active players as winners. Derived
* classes may wish to override this method in order to customize the winning conditions. * classes may wish to override this method in order to customize the winning conditions.
*/ */
@Override
protected void assignWinners (boolean[] winners) protected void assignWinners (boolean[] winners)
{ {
for (int ii = 0; ii < winners.length; ii++) { for (int ii = 0; ii < winners.length; ii++) {
@@ -520,7 +512,7 @@ public abstract class PuzzleManager extends GameManager
applyProgressEvents(pidx, events, states); applyProgressEvents(pidx, events, states);
} }
// documentation inherited @Override
protected void tick (long tickStamp) protected void tick (long tickStamp)
{ {
super.tick(tickStamp); super.tick(tickStamp);
@@ -163,9 +163,7 @@ public class PointSet
return _count; return _count;
} }
/** @Override
* Returns a string representation of the point set.
*/
public String toString () public String toString ()
{ {
StringBuilder buf = new StringBuilder(); StringBuilder buf = new StringBuilder();
@@ -33,8 +33,7 @@ import com.threerings.puzzle.client.PuzzlePanel;
public class PuzzleGameUtil public class PuzzleGameUtil
{ {
/** /**
* Returns a key translator configured with basic puzzle game * Returns a key translator configured with basic puzzle game mappings.
* mappings.
*/ */
public static KeyTranslatorImpl getKeyTranslator () public static KeyTranslatorImpl getKeyTranslator ()
{ {
@@ -42,8 +41,7 @@ public class PuzzleGameUtil
if (!PuzzlePanel.isRobotTesting()) { if (!PuzzlePanel.isRobotTesting()) {
// add the standard pause keys // add the standard pause keys
xlate.addPressCommand( xlate.addPressCommand(KeyEvent.VK_P, PuzzleController.TOGGLE_CHATTING);
KeyEvent.VK_P, PuzzleController.TOGGLE_CHATTING);
} }
return xlate; return xlate;
@@ -59,13 +59,13 @@ public class StageSceneController extends SpotSceneController
log.warning("handleClusterClicked(" + source + ", " + tuple + ")"); log.warning("handleClusterClicked(" + source + ", " + tuple + ")");
} }
// documentation inherited @Override
protected PlaceView createPlaceView (CrowdContext ctx) protected PlaceView createPlaceView (CrowdContext ctx)
{ {
return new StageScenePanel((StageContext)ctx, this); return new StageScenePanel((StageContext)ctx, this);
} }
// documentation inherited @Override
protected void sceneUpdated (SceneUpdate update) protected void sceneUpdated (SceneUpdate update)
{ {
super.sceneUpdated(update); super.sceneUpdated(update);
@@ -46,7 +46,7 @@ public class DefaultColorUpdate extends SceneUpdate
this.colorId = colorId; this.colorId = colorId;
} }
// documentation inherited @Override
public void apply (SceneModel model) public void apply (SceneModel model)
{ {
super.apply(model); super.apply(model);
@@ -54,7 +54,7 @@ public class ModifyObjectsUpdate extends SceneUpdate
this.removed = removed; this.removed = removed;
} }
// documentation inherited @Override
public void apply (SceneModel model) public void apply (SceneModel model)
{ {
super.apply(model); super.apply(model);
@@ -26,8 +26,6 @@ import com.threerings.util.MessageBundle;
import com.threerings.presents.data.InvocationCodes; import com.threerings.presents.data.InvocationCodes;
import com.threerings.presents.data.Permission; import com.threerings.presents.data.Permission;
import com.threerings.crowd.data.BodyObject;
/** /**
* Codes and constants relating to the Stage system. * Codes and constants relating to the Stage system.
*/ */
@@ -91,6 +91,7 @@ public class StageLocation extends SimpleStreamableObject
/** /**
* Location equality is determined by coordinates. * Location equality is determined by coordinates.
*/ */
@Override
public boolean equals (Object other) public boolean equals (Object other)
{ {
if (other instanceof StageLocation) { if (other instanceof StageLocation) {
@@ -105,14 +106,13 @@ public class StageLocation extends SimpleStreamableObject
/** /**
* Computes a reasonable hashcode for location instances. * Computes a reasonable hashcode for location instances.
*/ */
@Override
public int hashCode () public int hashCode ()
{ {
return x ^ y; return x ^ y;
} }
/** @Override
* Creates a clone of this instance.
*/
public Object clone () public Object clone ()
{ {
try { try {
@@ -25,8 +25,6 @@ import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import com.threerings.miso.data.ObjectInfo; import com.threerings.miso.data.ObjectInfo;
import com.threerings.miso.util.MisoUtil;
import com.threerings.crowd.data.PlaceConfig; import com.threerings.crowd.data.PlaceConfig;
import com.threerings.whirled.data.Scene; import com.threerings.whirled.data.Scene;
@@ -141,7 +139,7 @@ public class StageScene extends SceneImpl
return removed; return removed;
} }
// documentation inherited @Override
public void updateReceived (SceneUpdate update) public void updateReceived (SceneUpdate update)
{ {
super.updateReceived(update); super.updateReceived(update);
@@ -153,7 +151,7 @@ public class StageScene extends SceneImpl
readInterestingObjects(); readInterestingObjects();
} }
// documentation inherited @Override
public Object clone () public Object clone ()
throws CloneNotSupportedException throws CloneNotSupportedException
{ {

Some files were not shown because too many files have changed in this diff Show More