Have board summaries always update before being broadcast. Don't
generate a summary for every change to a player's board. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3777 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -147,8 +147,6 @@ public abstract class DropManagerDelegate extends PuzzleManagerDelegate
|
|||||||
*/
|
*/
|
||||||
protected void placedBlock (int pidx)
|
protected void placedBlock (int pidx)
|
||||||
{
|
{
|
||||||
// update the player's board levels
|
|
||||||
_puzmgr.updateBoardSummary(pidx);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The drop game board for each player. */
|
/** The drop game board for each player. */
|
||||||
|
|||||||
@@ -122,6 +122,21 @@ public abstract class PuzzleManager extends GameManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Applies updateBoardSummary on all the players' boards. AI board
|
||||||
|
* summaries should be updated by the AI logic.
|
||||||
|
*/
|
||||||
|
public void updateBoardSummaries ()
|
||||||
|
{
|
||||||
|
if (_puzobj.summaries != null) {
|
||||||
|
for (int ii = 0; ii < _puzobj.summaries.length; ii++) {
|
||||||
|
if (!isAI(ii)) {
|
||||||
|
updateBoardSummary(ii);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// documentation inherited
|
// documentation inherited
|
||||||
protected void playerGameDidEnd (int pidx)
|
protected void playerGameDidEnd (int pidx)
|
||||||
{
|
{
|
||||||
@@ -286,8 +301,9 @@ public abstract class PuzzleManager extends GameManager
|
|||||||
{
|
{
|
||||||
// if we're a board summary updating kind of puzzle, do that
|
// if we're a board summary updating kind of puzzle, do that
|
||||||
if (needsBoardSummaries()) {
|
if (needsBoardSummaries()) {
|
||||||
// they're already modified in-situ, so we just rebroadcast
|
// generate the latest summaries
|
||||||
// the latest versions
|
updateBoardSummaries();
|
||||||
|
// then broadcast them to the clients
|
||||||
_puzobj.setSummaries(_puzobj.summaries);
|
_puzobj.setSummaries(_puzobj.summaries);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user