Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Tetris-App/PieceProxy.java
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
58 lines (55 sloc)
1.19 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Write a description of class TetriminoProxy here. | |
* | |
* @author Greg Johnson, University of Connecticut | |
* @version 0.3 | |
*/ | |
public class PieceProxy implements Animatable | |
{ | |
// instance variables - replace the example below with your own | |
private Animatable _p; | |
/** | |
* An example of a method - replace this comment with your own | |
* | |
* @param y a sample parameter for a method | |
* @return the sum of x and y | |
*/ | |
public void setPiece(Animatable m) | |
{ | |
_p = m; | |
} | |
public void fill (java.awt.Graphics2D aBrush){ | |
_p.fill(aBrush); | |
} | |
public void draw (java.awt.Graphics2D aBrush) { | |
_p.draw(aBrush); | |
} | |
public SmartRectangle getBlockAt(int i) | |
{ | |
return _p.getBlockAt(i); | |
} | |
public boolean moveUp() | |
{ | |
return _p.moveUp(); | |
} | |
public boolean moveDown() | |
{ | |
return _p.moveDown(); | |
} | |
public boolean moveLeft() | |
{ | |
return _p.moveLeft(); | |
} | |
public boolean moveRight() | |
{ | |
return _p.moveRight(); | |
} | |
public boolean turnLeft() | |
{ | |
return _p.turnLeft(); | |
} | |
public boolean turnRight() | |
{ | |
return _p.turnRight(); | |
} | |
} |