/* * NEPiece - the northeast corner piece * * by Adam Doppelt * http://www.cs.brown.edu/people/amd/ */ import java.awt.*; public class NEPiece 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] = NWPiece.type_.y1_[loop]; type_.x2_[loop] = SIZE - NWPiece.type_.x2_[loop]; type_.y2_[loop] = NWPiece.type_.y2_[loop]; type_.visible_[loop] = NWPiece.type_.visible_[loop]; } type_.red_ = true; type_.green_ = false; type_.blue_ = true; type_.legalDirections_ = SOUTH + WEST; type_.flipDirections_ = WEST; if (image == null) type_.GenerateImage(); else type_.stamp_ = image; } public NEPiece() { super(type_); } public int Twist(int direction) { if (oldDirection_ == SOUTH) return EAST; else return NORTH; } }