made BonusCard Serializable and added the method calls to display handcards during the intro

This commit is contained in:
Hanno Fleischer
2024-12-05 22:46:48 +01:00
parent d8bb458e9c
commit 421231aa12
3 changed files with 8 additions and 2 deletions

View File

@@ -149,6 +149,7 @@ private void initializeSerializables() {
Serializer.registerClass(Color.class, new EnumSerializer());
Serializer.registerClass(PieceState.class, new EnumSerializer());
Serializer.registerClass(ShieldState.class, new EnumSerializer());
Serializer.registerClass(BonusCard.class, new EnumSerializer());
}
private void registerListeners() {

View File

@@ -5,7 +5,9 @@
import pp.mdga.client.gamestate.DetermineStartPlayerState;
import pp.mdga.game.Player;
import pp.mdga.message.client.AnimationEndMessage;
import pp.mdga.notification.AcquireCardNotification;
import pp.mdga.notification.ActivePlayerNotification;
import pp.mdga.notification.DrawCardNotification;
import pp.mdga.notification.MovePieceNotification;
import java.util.Map;
@@ -47,9 +49,9 @@ public void enter() {
logic.getGame().getBoard().getInfield()[entry.getValue().getStartNodeIndex()].setOccupant(entry.getValue().getPieces()[0]);
animationCounter++;
if(entry.getKey() == logic.getOwnPlayerId()){
//logic.addNotification(new AcquireCardNotification(entry.getValue().getHandCards().get(0)));
logic.addNotification(new AcquireCardNotification(entry.getValue().getHandCards().get(0)));
} else {
//logic.addNotification(new DrawCardNotification(entry.getValue().getColor(), entry.getValue().getHandCards().get(0)));
logic.addNotification(new DrawCardNotification(entry.getValue().getColor(), entry.getValue().getHandCards().get(0)));
}
}
}

View File

@@ -1,8 +1,11 @@
package pp.mdga.game;
import com.jme3.network.serializing.Serializable;
/**
* Enum representing the different types of bonus cards.
*/
@Serializable
public enum BonusCard {
/**
* The hidden bonus card.