mirror of
https://github.com/2OOP/pism.git
synced 2026-02-04 10:54:51 +00:00
Added takefromcommandqueue methods, removed throws and made internal to function
This commit is contained in:
@@ -43,8 +43,20 @@ public class TicTacToe extends GameBase implements Runnable {
|
|||||||
commandQueue.add(command);
|
commandQueue.add(command);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addSendToQueue(String send) throws InterruptedException {
|
private void takeFromCommandQueue() {
|
||||||
sendQueue.put(send);
|
try {
|
||||||
|
ParsedCommand cmd = this.commandQueue.take();
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
logger.error("Taking from queue interrupted, in game with id: {}", this.gameId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addSendToQueue(String send) {
|
||||||
|
try {
|
||||||
|
sendQueue.put(send);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
logger.error("Sending to queue interrupted, in game with id: {}", this.gameId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user