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

git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@670 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
Dave Hoover
2008-07-18 19:02:08 +00:00
parent f30cb74ace
commit 624daadcd9
171 changed files with 371 additions and 459 deletions
@@ -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