-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConcretePiece.java
More file actions
68 lines (55 loc) · 1.39 KB
/
Copy pathConcretePiece.java
File metadata and controls
68 lines (55 loc) · 1.39 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import java.util.Stack;
public abstract class ConcretePiece implements Piece{
protected int distance = 0;
protected Player player;
protected String type;
protected Stack<Position> places = new Stack<Position>();
protected String id;
public int getNummericid() {
return nummericid;
}
protected int nummericid;
protected int killCount = 0;
public void setId(String id , int nummericid) {
this.id = id;
this.nummericid = nummericid;
}
public String getId() {
return id;
}
public void addKill(){
this.killCount++;
}
public void removekill(){ this.killCount--;}
public int getKillCount(){
return this.killCount;
}
public Stack<Position> getPlaces() {
return places;
}
public void printPlaces(){
while (!places.isEmpty()){
System.out.print(places.pop()+ " ");
}
}
public void addPlace(Position position){
this.places.push(position);
}
@Override
public Player getOwner() {
return this.player;
}
@Override
public String getType() {
return this.type;
}
public int getDistance() {
return distance;
}
public void remDistance(int dis){
this.distance = this.distance-dis;
}
public void addDistance(int distance) {
this.distance += distance;
}
}