forked from External/mage
[minor] some formatting
This commit is contained in:
parent
105df2197f
commit
8c56231e15
3 changed files with 49 additions and 30 deletions
|
|
@ -57,8 +57,9 @@ public class GameManager {
|
|||
}
|
||||
|
||||
public void joinGame(UUID gameId, UUID userId) {
|
||||
if (gameControllers.containsKey(gameId))
|
||||
if (gameControllers.containsKey(gameId)) {
|
||||
gameControllers.get(gameId).join(userId);
|
||||
}
|
||||
}
|
||||
|
||||
public void destroyChatSession(UUID gameId) {
|
||||
|
|
@ -66,64 +67,76 @@ public class GameManager {
|
|||
}
|
||||
|
||||
public UUID getChatId(UUID gameId) {
|
||||
if (gameControllers.containsKey(gameId))
|
||||
if (gameControllers.containsKey(gameId)) {
|
||||
return gameControllers.get(gameId).getChatId();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void sendPlayerUUID(UUID gameId, UUID userId, UUID data) {
|
||||
if (gameControllers.containsKey(gameId))
|
||||
if (gameControllers.containsKey(gameId)) {
|
||||
gameControllers.get(gameId).sendPlayerUUID(userId, data);
|
||||
}
|
||||
}
|
||||
|
||||
public void sendPlayerString(UUID gameId, UUID userId, String data) {
|
||||
if (gameControllers.containsKey(gameId))
|
||||
if (gameControllers.containsKey(gameId)) {
|
||||
gameControllers.get(gameId).sendPlayerString(userId, data);
|
||||
}
|
||||
}
|
||||
|
||||
public void sendPlayerBoolean(UUID gameId, UUID userId, Boolean data) {
|
||||
if (gameControllers.containsKey(gameId))
|
||||
if (gameControllers.containsKey(gameId)) {
|
||||
gameControllers.get(gameId).sendPlayerBoolean(userId, data);
|
||||
}
|
||||
}
|
||||
|
||||
public void sendPlayerInteger(UUID gameId, UUID userId, Integer data) {
|
||||
if (gameControllers.containsKey(gameId))
|
||||
if (gameControllers.containsKey(gameId)) {
|
||||
gameControllers.get(gameId).sendPlayerInteger(userId, data);
|
||||
}
|
||||
}
|
||||
|
||||
public void concedeGame(UUID gameId, UUID userId) {
|
||||
if (gameControllers.containsKey(gameId))
|
||||
if (gameControllers.containsKey(gameId)) {
|
||||
gameControllers.get(gameId).concede(userId);
|
||||
}
|
||||
}
|
||||
|
||||
public void undo(UUID gameId, UUID userId) {
|
||||
if (gameControllers.containsKey(gameId))
|
||||
if (gameControllers.containsKey(gameId)) {
|
||||
gameControllers.get(gameId).undo(userId);
|
||||
}
|
||||
}
|
||||
|
||||
public void passPriorityUntilNextYourTurn(UUID gameId, UUID userId) {
|
||||
if (gameControllers.containsKey(gameId))
|
||||
if (gameControllers.containsKey(gameId)) {
|
||||
gameControllers.get(gameId).passPriorityUntilNextYourTurn(userId);
|
||||
}
|
||||
}
|
||||
|
||||
public void passTurnPriority(UUID gameId, UUID userId) {
|
||||
if (gameControllers.containsKey(gameId))
|
||||
if (gameControllers.containsKey(gameId)) {
|
||||
gameControllers.get(gameId).passTurnPriority(userId);
|
||||
}
|
||||
}
|
||||
|
||||
public void restorePriority(UUID gameId, UUID userId) {
|
||||
if (gameControllers.containsKey(gameId))
|
||||
if (gameControllers.containsKey(gameId)) {
|
||||
gameControllers.get(gameId).restorePriority(userId);
|
||||
}
|
||||
}
|
||||
|
||||
public void watchGame(UUID gameId, UUID userId) {
|
||||
if (gameControllers.containsKey(gameId))
|
||||
if (gameControllers.containsKey(gameId)) {
|
||||
gameControllers.get(gameId).watch(userId);
|
||||
}
|
||||
}
|
||||
|
||||
public void stopWatching(UUID gameId, UUID userId) {
|
||||
if (gameControllers.containsKey(gameId))
|
||||
if (gameControllers.containsKey(gameId)) {
|
||||
gameControllers.get(gameId).stopWatching(userId);
|
||||
}
|
||||
}
|
||||
|
||||
public void removeSession(UUID userId) {
|
||||
|
|
@ -133,24 +146,28 @@ public class GameManager {
|
|||
}
|
||||
|
||||
public void kill(UUID gameId, UUID userId) {
|
||||
if (gameControllers.containsKey(gameId))
|
||||
if (gameControllers.containsKey(gameId)) {
|
||||
gameControllers.get(gameId).kill(userId);
|
||||
}
|
||||
}
|
||||
|
||||
public void cheat(UUID gameId, UUID userId, UUID playerId, DeckCardLists deckList) {
|
||||
if (gameControllers.containsKey(gameId))
|
||||
if (gameControllers.containsKey(gameId)) {
|
||||
gameControllers.get(gameId).cheat(userId, playerId, deckList);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean cheat(UUID gameId, UUID userId, UUID playerId, String cardName) {
|
||||
if (gameControllers.containsKey(gameId))
|
||||
if (gameControllers.containsKey(gameId)) {
|
||||
return gameControllers.get(gameId).cheat(userId, playerId, cardName);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void timeout(UUID gameId, UUID userId) {
|
||||
if (gameControllers.containsKey(gameId))
|
||||
if (gameControllers.containsKey(gameId)) {
|
||||
gameControllers.get(gameId).timeout(userId);
|
||||
}
|
||||
}
|
||||
|
||||
public void removeGame(UUID gameId) {
|
||||
|
|
@ -158,13 +175,15 @@ public class GameManager {
|
|||
}
|
||||
|
||||
public void saveGame(UUID gameId) {
|
||||
if (gameControllers.containsKey(gameId))
|
||||
if (gameControllers.containsKey(gameId)) {
|
||||
gameControllers.get(gameId).saveGame();
|
||||
}
|
||||
}
|
||||
|
||||
public GameView getGameView(UUID gameId, UUID userId, UUID playerId) {
|
||||
if (gameControllers.containsKey(gameId))
|
||||
if (gameControllers.containsKey(gameId)) {
|
||||
return gameControllers.get(gameId).getGameView(playerId);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue