kuchuz

PBO-C EAS : Piece

Jan 11th, 2021
1,076
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.13 KB | None | 0 0
  1. package chessgui.pieces;
  2.  
  3. import chessgui.Board;
  4.  
  5. public class Piece {
  6.     private int x;
  7.     private int y;
  8.     final private boolean is_white;
  9.     private String file_path;
  10.     public Board board;
  11.    
  12.     public Piece(int x, int y, boolean is_white, String file_path, Board board)
  13.     {
  14.         this.is_white = is_white;
  15.         this.x = x;
  16.         this.y = y;
  17.         this.file_path = file_path;
  18.         this.board = board;
  19.     }
  20.    
  21.     public String getFilePath()
  22.     {
  23.         return file_path;
  24.     }
  25.    
  26.     public void setFilePath(String path)
  27.     {
  28.         this.file_path = path;
  29.     }
  30.    
  31.     public boolean isWhite()
  32.     {
  33.         return is_white;
  34.     }
  35.    
  36.     public boolean isBlack()
  37.     {
  38.         return !is_white;
  39.     }
  40.    
  41.     public void setX(int x)
  42.     {
  43.         this.x = x;
  44.     }
  45.    
  46.     public void setY(int y)
  47.     {
  48.         this.y = y;
  49.     }
  50.    
  51.     public int getX()
  52.     {
  53.         return x;
  54.     }
  55.    
  56.     public int getY()
  57.     {
  58.         return y;
  59.     }
  60.    
  61.     public boolean canMove(int destination_x, int destination_y)
  62.     {
  63.         return false;
  64.     }
  65. }
Advertisement
Add Comment
Please, Sign In to add comment