-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathKing.java
49 lines (38 loc) · 1.02 KB
/
King.java
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
//King class
public class King extends Chess implements StrategyChess{
public int quantity;
public King(){
super();
this.quantity = 1;
}
public King(String ChessPiece, String Color, int quantity){
super(ChessPiece, Color);
this.quantity = quantity;
}
public King(King another){
super(another.ChessPiece, another.Color);
this.quantity = another.quantity;
}
public String horizontalMove(){
return "Moved";
}
public String verticalMove(){
return "Moved";
}
public String crossMove(){
return "Moved";
}
public int maxRange(){
return 1;
}
public int minRange(){
return 1;
}
public String power(){
return "The most important unit in the game.";
}
@Override
public String toString(){
return "Chess[Piece = " + this.ChessPiece + ", Color = " + this.Color + ", Quantity = " + this.quantity + "].";
}
}