-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.java
More file actions
43 lines (36 loc) · 1.13 KB
/
main.java
File metadata and controls
43 lines (36 loc) · 1.13 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
import java.io.IOException;
import java.util.Observer;
import java.util.Scanner;
import java.util.Timer;
import java.util.TimerTask;
public class main {
public long myLong = 1234;
//Jardin jardin = new Jardin(4,4);
Observer obs;
public static void main(String[] args) throws IOException {
//On récupère le jardin de tmp
Jardin jardin = new Jardin(12,12);
Serre serre = new Serre(jardin, jardin);
//Minuteur pour passer les saisons
final main test = new main();
Timer timer = new Timer();
timer.schedule(new TimerTask() {
@Override
public void run() {
test.doStuff(jardin);
}
}, 0, test.myLong);
}
int global = 0;
public void doStuff(Jardin jardin){
System.out.println(global);
if (global == 5) {
jardin.saisonSuivante();
jardin.setMAJPousse(jardin.getEmplacements());
System.out.println(jardin.toString());
global = 0;
}else {
global++;
}
}
}