-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCazador.java
More file actions
46 lines (36 loc) · 736 Bytes
/
Cazador.java
File metadata and controls
46 lines (36 loc) · 736 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
public class Cazador {
//Declare Variables
private int HP;
private int catchPoints;
private int status;
private String nombre;
//Constructor
public Cazador (String name) {
nombre = name;
HP = 100;
status = 0;
catchPoints = 0;
}
//ACCESSORS
//Returns current HP value
public int getHP() {
return HP;
}
//Returns current number of catches
public int getCP () {
return catchPoints;
}
//Returns current status: 1 = won, 0 = in game, -1 = lost
public int getStatus(){
return status;
}
//MUTATORS
//Updates the HP (When a predator attacks)
public void setHP (int p) {
HP -= p;
}
//Updates the catch points
public void setCP (int p) {
catchPoints += p;
}
}