-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCustomer.java
More file actions
49 lines (38 loc) · 1.16 KB
/
Copy pathCustomer.java
File metadata and controls
49 lines (38 loc) · 1.16 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
import java.util.List;
public class Customer extends User {
private int points;
private CustomerState state;
public Customer(String username, String password) {
super(username, password);
this.points = 0;
this.state = new SilverState();
}
@Override
public boolean login(String inputUsername, String inputPassword) {
return this.username.equals(inputUsername) && this.password.equals(inputPassword);
}
public void buyBooks(List<Book> selectedBooks, boolean redeem) {
state.buyBooks(this, selectedBooks, redeem);
}
public void updateStatus() {
state.updateStatus(this);
}
public int getPoints() {
return points;
}
public void setPoints(int points) {
this.points = points;
}
public CustomerState getState() {
return state;
}
public void setState(CustomerState state) {
this.state = state;
}
public String getStatus() {
return state.getStatusName();
}
public String getStatusName() {
return getStatus();
}
}