com.threerings.puzzle.data
Class BoardSummary

java.lang.Object
  extended by com.threerings.io.SimpleStreamableObject
      extended by com.threerings.puzzle.data.BoardSummary
All Implemented Interfaces:
Streamable
Direct Known Subclasses:
DropBoardSummary

public abstract class BoardSummary
extends SimpleStreamableObject

Provides summarized data representing a player's board in a puzzle game. Board summaries are maintained by the puzzle server and are periodically sent to the clients to give them a view into how well their opponent(s) are doing. The data required to marshal a board summary object should be notably smaller in size than what would be required to marshal the entire associated Board.

Note all non-transient members of this and derived classes will automatically be serialized when the summary is sent over the wire.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.threerings.io.Streamable
Streamable.Closure
 
Field Summary
protected  Board _board
          The board that we're summarizing.
 
Constructor Summary
BoardSummary()
          Constructs an empty board summary for use when un-serializing.
BoardSummary(Board board)
          Constructs a board summary that retrieves full board information from the supplied board when summarizing.
 
Method Summary
 void setBoard(Board board)
          Sets the board associated with this board summary, causing an immediate update to this summary.
abstract  void summarize()
          Called by the PuzzleManager to refresh the board summary information by studying the associated board contents.
 
Methods inherited from class com.threerings.io.SimpleStreamableObject
toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_board

protected transient Board _board
The board that we're summarizing. This is only valid on the server, and on the client only for the actual player's board.

Constructor Detail

BoardSummary

public BoardSummary()
Constructs an empty board summary for use when un-serializing.


BoardSummary

public BoardSummary(Board board)
Constructs a board summary that retrieves full board information from the supplied board when summarizing.

Method Detail

setBoard

public void setBoard(Board board)
Sets the board associated with this board summary, causing an immediate update to this summary.


summarize

public abstract void summarize()
Called by the PuzzleManager to refresh the board summary information by studying the associated board contents.