|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.puzzle.data.Board
public abstract class Board
An abstract base class for generating and storing puzzle board data.
| Nested Class Summary | |
|---|---|
protected static class |
Board.BoardRandom
Used to generate random numbers. |
| Nested classes/interfaces inherited from interface com.threerings.io.Streamable |
|---|
Streamable.Closure |
| Field Summary | |
|---|---|
protected Board.BoardRandom |
_rando
The object we use to generate our random numbers. |
| 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. |
protected int |
getSeedForEvent(int pidx,
int gevent)
Returns a number of bits to read off the random number generator for this event. |
void |
initializeSeed(long seed)
Sets the seed in the board's random number generator and calls populate(). |
protected boolean |
isSeedingEvent(int pidx,
int gevent)
Returns whether this event is the sort of thing we should use to generate extra noise on our random number generator. |
protected void |
populate()
Called after the seed is set in the board to give derived classes a chance to do things like populating the board with random pieces. |
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, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected transient Board.BoardRandom _rando
| Constructor Detail |
|---|
public Board()
| Method Detail |
|---|
public abstract void dump()
public abstract void dumpAndCompare(Board other)
public abstract boolean equals(Board other)
public Board clone()
clone in class Objectpublic void initializeSeed(long seed)
populate().
public Random getRandom()
protected void populate()
public void seedFromEvent(int pidx,
int gevent)
pidx - the player index that submitted the progress event.gevent - the progress event itself.
protected boolean isSeedingEvent(int pidx,
int gevent)
protected int getSeedForEvent(int pidx,
int gevent)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||