}
if (!running || simulator.getGame().isFinished())
return;
// If it is a human, wait until graphical interaction
if (simulator.getAi() instanceof Human) {
Human human = (Human)simulator.getAi();
synchronized (lock) {
waiting = true;
pawn = null;
action = null;
while (waiting && running) {
try {
lock.wait(100);
} catch (InterruptedException e) {}
}
human.set(action);
waiting = false;
pawn = null;
action = null;
}
}