Add turboCardLogic

This commit is contained in:
Felix Koppe
2024-12-09 13:57:16 +01:00
parent 8943dfb15e
commit bf3d800c10

View File

@@ -41,8 +41,14 @@ public ServerCardVisitor(ServerGameLogic logic) {
*/ */
@Override @Override
public void visit(TurboCard card) { public void visit(TurboCard card) {
for (Piece piece : this.logic.getGame().getPlayerByColor(this.logic.getGame().getActiveColor()).getPieces()) {
if (piece.getState() == PieceState.ACTIVE) {
if (!this.cards.contains(card)) {
this.cards.add(card); this.cards.add(card);
} }
}
}
}
/** /**
* This method will be used to visit the given card parameter. * This method will be used to visit the given card parameter.