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