Formalize the notion of rematching a game so that derived classes can get
involved in the process. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3491 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -66,7 +66,17 @@ public class CardGameManager extends GameManager
|
|||||||
// Documentation inherited.
|
// Documentation inherited.
|
||||||
public void turnDidEnd ()
|
public void turnDidEnd ()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This should be called to start a rematched game. It just starts the
|
||||||
|
* current game anew, but provides a mechanism for derived classes to
|
||||||
|
* do special things when there is a rematch.
|
||||||
|
*/
|
||||||
|
public void rematchGame ()
|
||||||
|
{
|
||||||
|
startGame();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deals a hand of cards to the player at the specified index from
|
* Deals a hand of cards to the player at the specified index from
|
||||||
* the given Deck.
|
* the given Deck.
|
||||||
|
|||||||
@@ -301,7 +301,7 @@ public class TrickCardGameManagerDelegate extends TurnGameManagerDelegate
|
|||||||
|
|
||||||
// if all players accept the rematch, restart the game
|
// if all players accept the rematch, restart the game
|
||||||
if (getRematchRequestCount() == _cardGame.getPlayerCount()) {
|
if (getRematchRequestCount() == _cardGame.getPlayerCount()) {
|
||||||
_cgmgr.startGame();
|
_cgmgr.rematchGame();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user