Fix logic error regarding cardSelection
This commit is contained in:
@@ -1,16 +1,8 @@
|
||||
package pp.mdga.client;
|
||||
|
||||
import pp.mdga.client.acoustic.MdgaSound;
|
||||
import pp.mdga.client.server.MdgaServer;
|
||||
import pp.mdga.client.view.CeremonyView;
|
||||
import pp.mdga.client.view.GameView;
|
||||
import pp.mdga.client.view.LobbyView;
|
||||
import pp.mdga.game.BonusCard;
|
||||
import pp.mdga.game.Color;
|
||||
import pp.mdga.message.client.LobbyReadyMessage;
|
||||
import pp.mdga.notification.AcquireCardNotification;
|
||||
import pp.mdga.notification.DrawCardNotification;
|
||||
import pp.mdga.notification.TskSelectNotification;
|
||||
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Level;
|
||||
@@ -75,10 +67,10 @@ public void selectCard(BonusCard card) {
|
||||
|
||||
GameView gameView = (GameView) app.getView();
|
||||
|
||||
if(card == null) {
|
||||
if(card != null) {
|
||||
gameView.needConfirm();
|
||||
} else {
|
||||
gameView.needNoPower();
|
||||
gameView.showNoPower();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,16 +87,12 @@ public void confirm() {
|
||||
app.getGameLogic().selectPiece(a);
|
||||
gameView.getBoardHandler().clearSelectable();
|
||||
} else {
|
||||
if(null == card) {
|
||||
app.getGameLogic().selectCard(null);
|
||||
} else {
|
||||
app.getGameLogic().selectCard(card);
|
||||
gameView.getGuiHandler().clearSelectableCards();
|
||||
}
|
||||
app.getGameLogic().selectCard(card);
|
||||
gameView.getGuiHandler().clearSelectableCards();
|
||||
}
|
||||
|
||||
gameView.noConfirm();
|
||||
gameView.noNoPower();
|
||||
gameView.hideNoPower();
|
||||
}
|
||||
|
||||
public void selectTsk(Color color) {
|
||||
|
||||
@@ -164,7 +164,7 @@ private void handleGame(Notification notification) {
|
||||
}
|
||||
} else if (notification instanceof SelectableCardsNotification n) {
|
||||
guiHandler.setSelectableCards(n.getCards());
|
||||
gameView.needNoPower();
|
||||
gameView.showNoPower();
|
||||
} else if (notification instanceof ShieldActiveNotification n) {
|
||||
boardHandler.shieldPiece(n.getPieceId());
|
||||
} else if (notification instanceof ShieldSuppressedNotification n) {
|
||||
|
||||
@@ -122,13 +122,13 @@ public void noConfirm() {
|
||||
confirmButton.hide();
|
||||
}
|
||||
|
||||
public void needNoPower() {
|
||||
public void showNoPower() {
|
||||
confirmButton.hide();
|
||||
noPowerButton.show();
|
||||
}
|
||||
|
||||
public void noNoPower() {
|
||||
noPowerButton.show();
|
||||
public void hideNoPower() {
|
||||
noPowerButton.hide();
|
||||
}
|
||||
|
||||
public void enterInterrupt(Color color) {
|
||||
|
||||
Reference in New Issue
Block a user