-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPointAction.java
More file actions
48 lines (38 loc) · 933 Bytes
/
PointAction.java
File metadata and controls
48 lines (38 loc) · 933 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
public class PointAction {
private int pa;
public PointAction() {
this.pa = 0;
}
public PointAction(int pa) {
this.pa = pa;
}
public PointAction(PointAction point) {
this.pa = point.pa;
}
public void setPa(int pa){
this.pa = pa;
}
public int getPa() {
return this.pa;
}
public boolean checkAttack(int pa) { //ennemi est une instance de Monstre ou de Player
if (pa >= 3) { //si les points d'attaque sont supérieur ou éguale à 3 on peux attaque
return true;
}
else {
System.out.println("Le nombre de pa est insuffisant");
return false;
}
}
public int move(){
if (this.pa >= 2) {
System.out.println("Vous vous d�placez");
this.pa = this.pa-2;
return this.pa;
}
else {
System.out.println("Le nombre de pa est insuffisant");
return this.pa;
}
}
}