-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTile.java
More file actions
54 lines (46 loc) · 1.08 KB
/
Tile.java
File metadata and controls
54 lines (46 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import javafx.scene.layout.StackPane;
public class Tile {
public boolean isEmpty;
public int row;
public char column;
public Piece piece;
private StackPane cell;
public Tile(int row, char column){
setRow(row);
setColumn(column);
};
public void setPiece(Piece piece){
this.piece = piece;
}
public Piece getPiece(){
return piece;
}
public void setRow(int row){
if(row >= 1 && row <=8){
this.row = row;
}
else{
System.out.println("Row of Tile must be between 1 and 8");
}
}
public int getRow(){
return row;
}
public void setColumn(char column){
if(column>='A' && column <='H'){
this.column = column;
}
else{
System.out.println("Column of Tile must be between 'a' and 'h'");
}
}
public char getColumn(){
return this.column;
}
public void setCell(StackPane cell){
this.cell = cell;
}
public StackPane getCell(){
return this.cell;
}
}