com.threerings.puzzle.data
Class Board

java.lang.Object
  extended by com.threerings.puzzle.data.Board
All Implemented Interfaces:
com.threerings.io.Streamable, Cloneable
Direct Known Subclasses:
DropBoard

public abstract class Board
extends Object
implements Cloneable, com.threerings.io.Streamable

An abstract base class for generating and storing puzzle board data.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.threerings.io.Streamable
com.threerings.io.Streamable.Closure
 
Constructor Summary
Board()
           
 
Method Summary
 Board clone()
           
abstract  void dump()
          Outputs a string representation of the board contents.
abstract  void dumpAndCompare(Board other)
          Outputs a string representation of the board contents, interlaced with the supplied comparison board.
abstract  boolean equals(Board other)
          Returns whether this board is equal to the given comparison board.
 Random getRandom()
          Returns the random number generator used by the board to generate random numbers for our puzzles.
 void initializeSeed(long seed)
          Sets the seed in the board's random number generator and calls populate().
 void seedFromEvent(int pidx, int gevent)
          Allows puzzles to add extra noise to their random number generators based on the specific events sent from the client to make it more difficult for a hacked client to predict things such as piece generation.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Board

public Board()
Method Detail

dump

public abstract void dump()
Outputs a string representation of the board contents.


dumpAndCompare

public abstract void dumpAndCompare(Board other)
Outputs a string representation of the board contents, interlaced with the supplied comparison board.


equals

public abstract boolean equals(Board other)
Returns whether this board is equal to the given comparison board.


clone

public Board clone()
Overrides:
clone in class Object

initializeSeed

public void initializeSeed(long seed)
Sets the seed in the board's random number generator and calls populate().


getRandom

public Random getRandom()
Returns the random number generator used by the board to generate random numbers for our puzzles.


seedFromEvent

public void seedFromEvent(int pidx,
                          int gevent)
Allows puzzles to add extra noise to their random number generators based on the specific events sent from the client to make it more difficult for a hacked client to predict things such as piece generation.

Parameters:
pidx - the player index that submitted the progress event.
gevent - the progress event itself.


Copyright © 2011. All Rights Reserved.