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