public class PieceDestroyer extends Object implements DropPieceCodes
| Modifier and Type | Class and Description |
|---|---|
static interface |
PieceDestroyer.DestroyLogic
An interface to be implemented by specific puzzles to detail the parameters and methodology
by which pieces are destroyed in the puzzle board.
|
DROP_BLOCK_PIECE_COUNT, PIECE_NONECARDINAL_DIRECTIONS, CCW, CW, DIRECTION_COUNT, DOWN, EAST, EASTNORTHEAST, EASTSOUTHEAST, FINE_DIRECTION_COUNT, HORIZONTAL, LEFT, NONE, NORTH, NORTHEAST, NORTHNORTHEAST, NORTHNORTHWEST, NORTHWEST, RIGHT, SOUTH, SOUTHEAST, SOUTHSOUTHEAST, SOUTHSOUTHWEST, SOUTHWEST, UP, VERTICAL, WEST, WESTNORTHWEST, WESTSOUTHWEST| Constructor and Description |
|---|
PieceDestroyer(PieceDestroyer.DestroyLogic logic)
Constructs a piece destroyer that destroys pieces as specified by the supplied destroy
logic.
|
| Modifier and Type | Method and Description |
|---|---|
List<SegmentInfo> |
destroyPieces(DropBoard board,
DropBoard.PieceOperation destroyOp)
Destroys all pieces in the given board that are in contiguous rows or columns of pieces,
returning a list of
SegmentInfo objects detailing the destroyed piece segments. |
public PieceDestroyer(PieceDestroyer.DestroyLogic logic)
public List<SegmentInfo> destroyPieces(DropBoard board, DropBoard.PieceOperation destroyOp)
SegmentInfo objects detailing the destroyed piece segments.
Note that a single list is used internally to gather the segment info, and so callers that
care to modify the list should create their own copy; also, the pieces in the segments may
overlap, i.e., two segments may contain the same piece.Copyright © 2015. All rights reserved.