-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTest.java
77 lines (68 loc) · 1.51 KB
/
Test.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
class Test extends Thread {
상대 s;
장수 me;
Test(상대 s, 장수 me) {
this.s = s;
this.me = me;
}
public void run() {
while (true) {
if (s.hp <= 0) {
break;
}
s.attack(me);
try {
Thread.sleep(2000);
} catch (Exception e) {
System.err.println(e.toString());
}
}
}
}
class test1 extends Thread{
조조 s;
장수 me;
test1(조조 s, 장수 me) {
this.s = s;
this.me = me;
}
public void run() {
while (true) {
if (s.hp <= 0) {
break;
}
s.attack(me);
try {
Thread.sleep(2000);
} catch (Exception e) {
System.err.println(e.toString());
}
}
}
}
class Test2 extends Thread {
상대 s;
장수 me;
조조1 z;
Test2(상대 s, 장수 me,조조1 z) {
this.s = s;
this.me = me;
this.z = z;
}
public void run() {
while (true) {
if (s.hp <= 0) {
break;
}
if(z.hp<=0){
break;
}
s.attack(me);
try {
Thread.sleep(2000);
} catch (Exception e) {
System.err.println(e.toString());
}
}
}
}