forked from External/mage
Mostly code format fixes.
This commit is contained in:
parent
7cf4ca3cae
commit
f99cd21275
37 changed files with 226 additions and 189 deletions
|
|
@ -95,11 +95,7 @@ public class TableController {
|
|||
if (userId != null) {
|
||||
Optional<User> user = UserManager.getInstance().getUser(userId);
|
||||
// TODO: Handle if user == null
|
||||
if (user.isPresent()) {
|
||||
controllerName = user.get().getName();
|
||||
} else {
|
||||
controllerName = "undefined";
|
||||
}
|
||||
controllerName = user.map(User::getName).orElse("undefined");
|
||||
} else {
|
||||
controllerName = "System";
|
||||
}
|
||||
|
|
@ -671,9 +667,7 @@ public class TableController {
|
|||
if (entry.getValue().equals(playerId)) {
|
||||
Optional<User> user = UserManager.getInstance().getUser(entry.getKey());
|
||||
int remaining = (int) futureTimeout.getDelay(TimeUnit.SECONDS);
|
||||
if (user.isPresent()) {
|
||||
user.get().ccSideboard(deck, table.getId(), remaining, options.isLimited());
|
||||
}
|
||||
user.ifPresent(user1 -> user1.ccSideboard(deck, table.getId(), remaining, options.isLimited()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -811,10 +805,7 @@ public class TableController {
|
|||
private synchronized void setupTimeout(int seconds) {
|
||||
cancelTimeout();
|
||||
if (seconds > 0) {
|
||||
futureTimeout = timeoutExecutor.schedule(
|
||||
() -> autoSideboard(),
|
||||
seconds, TimeUnit.SECONDS
|
||||
);
|
||||
futureTimeout = timeoutExecutor.schedule(this::autoSideboard, seconds, TimeUnit.SECONDS);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue