No longer assume that all board summaries are blank at the beginning

of the game- go ahead and initialize them and set them in the game object
when the game starts.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3495 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2005-04-15 21:44:36 +00:00
parent 6d0648b0b7
commit 90e3065751
3 changed files with 11 additions and 10 deletions
@@ -1,5 +1,5 @@
//
// $Id: BoardSummary.java,v 1.3 2004/08/27 02:20:28 mdb Exp $
// $Id$
//
// Narya library - tools for developing networked games
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
@@ -54,11 +54,13 @@ public abstract class BoardSummary extends TrackedStreamableObject
}
/**
* Sets the board associated with this board summary.
* Sets the board associated with this board summary, causing
* an immediate update to this summary.
*/
public void setBoard (Board board)
{
_board = board;
summarize(); // immediately summarize the new board
}
/**
@@ -1,5 +1,5 @@
//
// $Id: DropBoardSummary.java,v 1.2 2004/08/27 02:20:30 mdb Exp $
// $Id$
//
// Narya library - tools for developing networked games
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
@@ -47,9 +47,6 @@ public class DropBoardSummary extends BoardSummary
public DropBoardSummary (Board board)
{
super(board);
// create the columns array
columns = new byte[_dboard.getWidth()];
}
/**
@@ -72,9 +69,11 @@ public class DropBoardSummary extends BoardSummary
// documentation inherited
public void setBoard (Board board)
{
super.setBoard(board);
_dboard = (DropBoard)board;
// create the columns array
columns = new byte[_dboard.getWidth()];
super.setBoard(board);
}
// documentation inherited
@@ -389,8 +389,8 @@ public abstract class PuzzleManager extends GameManager
}
}
}
// these will be sent to the players on the first status update
_puzobj.summaries = summaries;
_puzobj.setSummaries(summaries);
}
/**