/*
 * SEPiece - the southeast corner piece
 *
 * by Adam Doppelt
 * http://www.cs.brown.edu/people/amd/
 */
import java.awt.*;

public class SEPiece extends Piece {
    static PieceType type_;

    static public void SetupStatics(Component c, Image image) {
	type_ = new PieceType(c);
	for (int loop = 0; loop < SLICES; ++loop) {
	    type_.x1_[loop] = SIZE - NWPiece.type_.x1_[loop];
	    type_.y1_[loop] = SIZE - NWPiece.type_.y1_[loop];
	    type_.x2_[loop] = SIZE - NWPiece.type_.x2_[loop];
	    type_.y2_[loop] = SIZE - NWPiece.type_.y2_[loop];
	    type_.visible_[loop] = NWPiece.type_.visible_[loop];
	}
	type_.red_ = true;
	type_.green_ = true;
	type_.blue_ = false;
	
	type_.legalDirections_ = NORTH + WEST;
	type_.flipDirections_ = WEST;
	if (image == null)
	    type_.GenerateImage();
	else
	    type_.stamp_ = image;
    }

    public SEPiece() {
	super(type_);
    }

    public int Twist(int direction) {
        if (oldDirection_ == NORTH)
	    return EAST;
        else
	    return SOUTH;
    }
}
