Enforce the use of Game{Controller|Manager}Delegates where needed.

git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@654 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
Michael Bayne
2008-07-10 13:19:52 +00:00
parent fa93b7ccf9
commit 17ffca41e7
2 changed files with 19 additions and 0 deletions
@@ -296,6 +296,16 @@ public abstract class GameController extends PlaceController
});
}
@Override // from PlaceController
protected void ratifyDelegate (PlaceControllerDelegate delegate)
{
super.ratifyDelegate(delegate);
if (!(delegate instanceof GameControllerDelegate)) {
throw new IllegalArgumentException(
"Must provide GameController with GameControllerDelegate");
}
}
/** A reference to the active parlor context. */
protected ParlorContext _ctx;
@@ -1283,6 +1283,15 @@ public class GameManager extends PlaceManager
// nothing for now
}
@Override // from PlaceManager
protected void ratifyDelegate (PlaceManagerDelegate delegate)
{
super.ratifyDelegate(delegate);
if (!(delegate instanceof GameManagerDelegate)) {
throw new IllegalArgumentException("Must provide GameManager with GameManagerDelegate");
}
}
/** Listens for game state changes. */
protected AttributeChangeListener _stateListener = new AttributeChangeListener() {
public void attributeChanged (AttributeChangedEvent event) {