-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBoss.java
More file actions
29 lines (23 loc) · 767 Bytes
/
Copy pathBoss.java
File metadata and controls
29 lines (23 loc) · 767 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
package blockchain;
import java.util.List;
import java.util.Objects;
import java.util.Random;
//店老板
public class Boss extends Man implements Runnable {
private final List<Man> employeeList;
public Boss(int id, List<Man> manList, List<Man> employeeList, Blockchain blockchain) {
super(id, "boss", manList, blockchain);
this.employeeList = employeeList;
}
@Override
public boolean translationCondition(Man man) {
//只要老板,并且不是自己
return Objects.equals(man.getSocialStatus(), "boss") && man.getId() != getId();
}
@Override
public void run() {
Random rand = new Random();
regularExpend(employeeList, 30 + rand.nextInt(5) , 60);
randomExpend();
}
}