103 lines
2.0 KiB
Java
103 lines
2.0 KiB
Java
/**
|
|
* <PRE>
|
|
* GamePiece.java
|
|
*
|
|
* Revisions: 1.0 Nov. 11, 2002
|
|
* Created the GamePiece class
|
|
* 1.1 Nov. 11, 2002
|
|
* Compiled, Commented, Finished
|
|
*
|
|
* </PRE>
|
|
*
|
|
* Collaboration Statement:
|
|
* I worked on the homework assignment alone, using only
|
|
* course materials.
|
|
*
|
|
* Created with JCreatorLE, some indents are off when viewed through notepad
|
|
* or EMACS
|
|
*
|
|
* @author <A HREF="mailto:gtg184g@mail.gatech.edu">Jose Manuel Caban</A>
|
|
* @version Version 1.1, Nov. 11, 2002
|
|
*/
|
|
|
|
public abstract class GamePiece {
|
|
|
|
/////////////////////////////////////////////////////
|
|
//coordinates such that (0,0) is the top left pixel//
|
|
/////////////////////////////////////////////////////
|
|
|
|
/**
|
|
*The X-Pos
|
|
*/
|
|
protected int x;
|
|
|
|
/**
|
|
*The Y-Pos
|
|
*/
|
|
protected int y;
|
|
|
|
///////////////
|
|
//Constructor//
|
|
///////////////
|
|
|
|
/**
|
|
*Default Constructor for GamePiece
|
|
*@param x, the x coordinate
|
|
*@param y, the y coordinate
|
|
*/
|
|
public GamePiece(int x, int y){
|
|
this.x = x;
|
|
this.y = y;
|
|
}
|
|
|
|
/////////////
|
|
//Accessors//
|
|
/////////////
|
|
|
|
/**
|
|
*@return the X-Corrdinate
|
|
*/
|
|
public int getX(){
|
|
return x;
|
|
}
|
|
|
|
/**
|
|
*@return the Y-Coordinate
|
|
*/
|
|
public int getY(){
|
|
return y;
|
|
}
|
|
|
|
///////////
|
|
//Methods//
|
|
///////////
|
|
|
|
/**
|
|
*@param x, the x value of the piece
|
|
*@param y, the y value of the piece
|
|
*/
|
|
public void setPosition(int x, int y){
|
|
this.x = x;
|
|
this.y = y;
|
|
}
|
|
|
|
public String toString(){
|
|
return ("[X: " +x+ "Y: " +y+ "]");
|
|
}
|
|
|
|
/***********************************************************/
|
|
|
|
/**
|
|
* Debugging main for class GamePiece.
|
|
* This method will rigorously test my code.
|
|
*
|
|
* <br><br>
|
|
* @param args a String array of command line arguments.
|
|
*/
|
|
public static void main(String[] args) {
|
|
|
|
|
|
}// end of main(String[] args)
|
|
|
|
}// end of class GamePiece
|