-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPokemon.java
57 lines (45 loc) · 967 Bytes
/
Pokemon.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
50
51
52
53
54
55
56
57
public class Pokemon {
private String name;
private int health;
private String type;
private static int count = 0;
public Pokemon() {
super();
}
public Pokemon(String name, int health, String type) {
super();
this.name = name;
this.health = health;
this.type = type;
count++;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getHealth() {
return health;
}
public void setHealth(int health) {
this.health = health;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public static int Count() {
return count;
}
@Override
public String toString() {
return "Pokemon [getName()=" + getName() + ", getHealth()=" + getHealth() + ", getType()=" + getType() + "]";
}
public void attackPokemon(Pokemon pokemon) {
System.out.println(this.name + " ATACO A -> " + pokemon.name);
this.health -= 10;
}
}