-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlayer.java
More file actions
43 lines (33 loc) · 741 Bytes
/
Copy pathPlayer.java
File metadata and controls
43 lines (33 loc) · 741 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
package fr.domp.test_java;
public class Player {
private String name = "Domi";
private double health = 20;
private double attack = 0.5;
public Player(String name, double attack, double health) {
this.name = name;
this.health = health;
this.attack = attack;
}
public void damage(double damage) {
this.health -= damage;
System.out.println(name + " vient de subir " + damage);
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double getHealth() {
return health;
}
public void setHealth(double health) {
this.health = health;
}
public double getAttack() {
return attack;
}
public void setAttack(double attack) {
this.attack = attack;
}
}