Added 'HiddenCard', 'ShieldCard', 'SwapCard' and 'TurboCard' classes.

Updated the 'HiddenCard', 'ShieldCard', 'SwapCard' and 'TurboCard' classes to this project. They will be used to display different types of power cards.
This commit is contained in:
Daniel Grigencha
2024-12-06 00:04:21 +01:00
parent a09211da5f
commit 6894802c00
4 changed files with 107 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
package pp.mdga.game.card;
import pp.mdga.game.BonusCard;
import pp.mdga.visitor.Visitor;
/**
* This class represents the hidden power card of this application.
*/
public class HiddenCard extends PowerCard {
/**
* Constructor.
*/
public HiddenCard() {
this.card = BonusCard.HIDDEN;
}
/**
* This method will be used to call the visit method of the given visitor parameter and pass a PowerCard object.
*
* @param visitor as the visitor which will differentiates between all types of power card types as a Visitor
* interface.
*/
@Override
public void accept(Visitor visitor) {
visitor.visit(this);
}
}

View File

@@ -0,0 +1,26 @@
package pp.mdga.game.card;
import pp.mdga.game.BonusCard;
import pp.mdga.visitor.Visitor;
/**
* This class represents the shield power card of this application.
*/
public class ShieldCard extends PowerCard {
/**
* Constructor.
*/
public ShieldCard() {
this.card = BonusCard.SHIELD;
}
/**
* This method will be used to call the visit method of the given visitor parameter and pass a PowerCard object.
*
* @param visitor as the visitor which will differentiates between all types of power card types as a Visitor
* interface.
*/
@Override
public void accept(Visitor visitor) {
visitor.visit(this);
}
}

View File

@@ -0,0 +1,27 @@
package pp.mdga.game.card;
import pp.mdga.game.BonusCard;
import pp.mdga.visitor.Visitor;
/**
* This class represents the swap power card of this application.
*/
public class SwapCard extends PowerCard {
/**
* Constructor.
*/
public SwapCard() {
this.card = BonusCard.SWAP;
}
/**
* This method will be used to call the visit method of the given visitor parameter and pass a PowerCard object.
*
* @param visitor as the visitor which will differentiates between all types of power card types as a Visitor
* interface.
*/
@Override
public void accept(Visitor visitor) {
visitor.visit(this);
}
}

View File

@@ -0,0 +1,27 @@
package pp.mdga.game.card;
import pp.mdga.game.BonusCard;
import pp.mdga.visitor.Visitor;
/**
* This class represents the turbo power card of this application.
*/
public class TurboCard extends PowerCard {
/**
* Constructor.
*/
public TurboCard() {
this.card = BonusCard.TURBO;
}
/**
* This method will be used to call the visit method of the given visitor parameter and pass a PowerCard object.
*
* @param visitor as the visitor which will differentiates between all types of power card types as a Visitor
* interface.
*/
@Override
public void accept(Visitor visitor) {
visitor.visit(this);
}
}