Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- --------------------------------------------------------------------------------
- AssassinIzdari : Piece
- Represents playing pieces on the game board. Has a location, an Image
- stored in memory, and a team.
- --------------------------------------------------------------------------------
- */
- import java.awt.*;
- public class Piece {
- private int x = 0;
- private int y = 0;
- private Image pic;
- private int team;
- public Piece(int xPos, int yPos, Image picImage, int pieceTeam) {
- this.x = xPos;
- this.y = yPos;
- this.pic = picImage;
- this.team = pieceTeam;
- }
- public void setX(int xVal) {
- this.x = xVal;
- }
- public void setY(int yVal) {
- this.y = yVal;
- }
- public Image returnImage() {
- return this.pic;
- }
- public int getDrawX() {
- return 8 + 40 * this.x;
- }
- public int getDrawY() {
- return 13 + 40 * this.y;
- }
- public int getX() {
- return this.x;
- }
- public int getY() {
- return this.y;
- }
- public int getTeam() {
- return this.team;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement