game_of_life_3d/GoL3D1/thread.pde
2025-07-10 03:45:41 +02:00

35 lines
610 B
Text

public class thVita extends Thread {
private boolean running;
private int wait;
public thVita () {
running = true;
this.wait = round((1/csAgg.getValueF())*1000);
this.start();
}
boolean isRunning(){
return this.running;
}
public void setWait(int wait){
this.wait = wait;
//println(wait);
}
void run () {
//apro il socket
while (running) {
try {
//println("agg");
getFate();
Thread.sleep(wait); // 1/40 di secondo
setFate();
}
catch(InterruptedException e) {
running = false;
}
}
}
}