first commit
This commit is contained in:
commit
b827bb4ce6
14 changed files with 673 additions and 0 deletions
35
GoL3D1/thread.pde
Normal file
35
GoL3D1/thread.pde
Normal file
|
@ -0,0 +1,35 @@
|
|||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue