Delegation! Since it's clear that extracting services into delegation
classes is only going to become more common, I've gone and created a comprehensive facility for creating and using delegates in the place controller and manager as well as the game controller and manager. With the pattern nicely set, it is also easy to extend to controller/managers further up the hierarchy that might need to delegate special methods of their own. Whee! git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@994 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
//
|
||||
// $Id: GameControllerDelegate.java,v 1.1 2002/02/13 03:21:28 mdb Exp $
|
||||
|
||||
package com.threerings.parlor.game;
|
||||
|
||||
import com.threerings.crowd.client.PlaceControllerDelegate;
|
||||
|
||||
/**
|
||||
* Extends the {@link PlaceControllerDelegate} mechanism with game
|
||||
* controller specific methods.
|
||||
*/
|
||||
public class GameControllerDelegate extends PlaceControllerDelegate
|
||||
{
|
||||
/**
|
||||
* Provides the delegate with a reference to the game controller for
|
||||
* which it is delegating.
|
||||
*/
|
||||
public GameControllerDelegate (GameController ctrl)
|
||||
{
|
||||
super(ctrl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the game transitions to the <code>IN_PLAY</code>
|
||||
* state. This happens when all of the players have arrived and the
|
||||
* server starts the game.
|
||||
*/
|
||||
public void gameDidStart ()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the game transitions to the <code>GAME_OVER</code>
|
||||
* state. This happens when the game reaches some end condition by
|
||||
* normal means (is not cancelled or aborted).
|
||||
*/
|
||||
public void gameDidEnd ()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the game was cancelled for some reason.
|
||||
*/
|
||||
public void gameWasCancelled ()
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user