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

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

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

An operation that sets the pieces in a board segment to a specified array of pieces.


Field Summary
protected  int _dir
          The orientation in which the pieces are to be placed.
protected  int _idx
          The current piece index.
protected  int[] _pieces
          The pieces to set in the board.
 
Constructor Summary
protected DropBoard.SetSegmentOperation()
           
 
Method Summary
 boolean execute(DropBoard board, int col, int row)
          Called for each piece in the board segment the operation is being applied to.
 void init(int dir, int[] pieces)
          Sets the array of pieces 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

_dir

protected int _dir
The orientation in which the pieces are to be placed.


_idx

protected int _idx
The current piece index.


_pieces

protected int[] _pieces
The pieces to set in the board.

Constructor Detail

DropBoard.SetSegmentOperation

protected DropBoard.SetSegmentOperation()
Method Detail

init

public void init(int dir,
                 int[] pieces)
Sets the array of pieces to be placed in the board segment.


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.