com.threerings.puzzle.drop.data
Class DropBoard.SetPieceOperation

java.lang.Object
  extended by com.threerings.puzzle.drop.data.DropBoard.SetPieceOperation
All Implemented Interfaces:
DropBoard.PieceOperation
Enclosing class:
DropBoard

protected static class DropBoard.SetPieceOperation
extends Object
implements DropBoard.PieceOperation

An operation that sets all pieces to a specified piece.


Field Summary
protected  boolean _error
          Set to true if an error occurred setting a piece.
protected  int _piece
          The piece to set in the board.
 
Constructor Summary
protected DropBoard.SetPieceOperation()
           
 
Method Summary
 boolean execute(DropBoard board, int col, int row)
          Called for each piece in the board segment the operation is being applied to.
 boolean getError()
          Returns true if we attempted to set a piece outside the bounds of the board during the course of our operation.
 void init(int piece)
          Sets the piece to be placed in the board segment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_piece

protected int _piece
The piece to set in the board.


_error

protected boolean _error
Set to true if an error occurred setting a piece.

Constructor Detail

DropBoard.SetPieceOperation

protected DropBoard.SetPieceOperation()
Method Detail

init

public void init(int piece)
Sets the piece to be placed in the board segment.


getError

public boolean getError()
Returns true if we attempted to set a piece outside the bounds of the board during the course of our operation.


execute

public boolean execute(DropBoard board,
                       int col,
                       int row)
Description copied from interface: DropBoard.PieceOperation
Called for each piece in the board segment the operation is being applied to.

Specified by:
execute in interface DropBoard.PieceOperation
Returns:
true if the operation should continue to be applied if being applied to multiple pieces, or false if it should terminate after this application.