-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathPieceBishop.java
More file actions
55 lines (46 loc) · 1013 Bytes
/
PieceBishop.java
File metadata and controls
55 lines (46 loc) · 1013 Bytes
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
55
import javafx.scene.image.Image;
public class PieceBishop extends Piece{
public String name = "Bishop";
public String imgname = "bishop.png";
private Piece[][] boardstate;
private int i;
private int j;
private int te;
public PieceBishop(int type, int ii, int jj) {
super(type);
te=type;
i = ii;
j = jj;
}
@Override
public Image image(){
if(te==1)
return new Image("whitebishopcursor.png");
else
return new Image("blackbishopcursor.png");
}
@Override
public int icoord(){
return i;
}
@Override
public int jcoord(){
return j;
}
@Override
public String toString(){
return name;
}
@Override
public String imagefilename(){
return imgname;
}
public Piece[][] movebishop(Piece b, Piece t, Piece[][] bs){
boardstate = bs;
// Move pawn
boardstate[t.icoord()][t.jcoord()] = new PieceBishop(b.type(), t.icoord(), t.jcoord());
boardstate[b.icoord()][b.jcoord()] = new Empty(0, b.icoord(), b.jcoord());
// Return the new board
return boardstate;
}
}