com.threerings.puzzle.drop.util

## Class PieceDestroyer

- java.lang.Object
- - com.threerings.puzzle.drop.util.PieceDestroyer

All Implemented Interfaces:
  DropPieceCodes, com.threerings.util.DirectionCodes

    public class PieceDestroyer
    extends Object
    implements DropPieceCodes

Handles destroying contiguous piece segments in a drop board.

### Nested Class Summary

Nested Classes
`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.

### Field Summary

### Fields inherited from interface com.threerings.puzzle.drop.data.DropPieceCodes

`DROP_BLOCK_PIECE_COUNT, PIECE_NONE`

### Fields inherited from interface com.threerings.util.DirectionCodes

`CARDINAL_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 Summary

Constructors
Constructor and Description
`PieceDestroyer(PieceDestroyer.DestroyLogic logic)` Constructs a piece destroyer that destroys pieces as specified by the supplied destroy logic.

### Method Summary

All Methods Instance Methods Concrete Methods
`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.

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### PieceDestroyer

    public PieceDestroyer(PieceDestroyer.DestroyLogic logic)

Constructs a piece destroyer that destroys pieces as specified by the supplied destroy logic.

### Method Detail

#### destroyPieces

    public 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. 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.