Advertisement
Guest User

Piece ( AssassinIzdari v1.0 - ArmageddonMUD Board Game )

a guest
Jan 22nd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.05 KB | None | 0 0
  1.     /*
  2. --------------------------------------------------------------------------------
  3.         AssassinIzdari : Piece
  4.        
  5.         Represents playing pieces on the game board.  Has a location, an Image
  6.         stored in memory, and a team.
  7. --------------------------------------------------------------------------------
  8.     */
  9.  
  10. import java.awt.*;
  11.  
  12. public class Piece {
  13.  
  14.     private int x = 0;
  15.     private int y = 0;
  16.  
  17.     private Image pic;
  18.  
  19.     private int team;
  20.  
  21.     public Piece(int xPos, int yPos, Image picImage, int pieceTeam) {
  22.  
  23.         this.x = xPos;
  24.         this.y = yPos;
  25.  
  26.         this.pic = picImage;
  27.  
  28.         this.team = pieceTeam;
  29.     }
  30.    
  31.     public void setX(int xVal) {
  32.  
  33.         this.x = xVal;
  34.     }
  35.  
  36.     public void setY(int yVal) {
  37.    
  38.         this.y = yVal;
  39.     }      
  40.  
  41.     public Image returnImage() {
  42.  
  43.         return this.pic;
  44.     }
  45.  
  46.     public int getDrawX() {
  47.  
  48.         return 8 + 40 * this.x;
  49.     }
  50.    
  51.     public int getDrawY() {
  52.  
  53.         return 13 + 40 * this.y;
  54.     }
  55.    
  56.     public int getX() {
  57.    
  58.         return this.x;
  59.     }
  60.    
  61.     public int getY() {
  62.    
  63.         return this.y;
  64.     }
  65.  
  66.     public int getTeam() {
  67.    
  68.         return this.team;
  69.     }
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement