2020-03-03 02:38:25 +01:00
|
|
|
package inf112.fiasko.roborally.objects;
|
|
|
|
|
|
|
|
import inf112.fiasko.roborally.element_properties.Action;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This class represents a programming card
|
|
|
|
*/
|
|
|
|
public class ProgrammingCard implements ICardWithoutSuit<Integer, Action> {
|
|
|
|
|
2020-03-03 17:25:18 +01:00
|
|
|
private final Integer cardValue;
|
|
|
|
private final Action cardAction;
|
2020-03-03 02:38:25 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Initializes the value and the action of the card
|
|
|
|
* @param cardValue the value of the card
|
|
|
|
* @param cardAction the action of the card
|
|
|
|
*/
|
2020-03-03 17:25:18 +01:00
|
|
|
public ProgrammingCard(int cardValue, Action cardAction){
|
|
|
|
this.cardValue = cardValue;
|
|
|
|
this.cardAction = cardAction;
|
2020-03-03 02:38:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public Integer getValue() {
|
|
|
|
return cardValue;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public Action getSymbol() {
|
|
|
|
return cardAction;
|
|
|
|
}
|
2020-03-03 17:25:18 +01:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return this.getValue() + " " + this.cardAction.toString();
|
|
|
|
}
|
2020-03-03 02:38:25 +01:00
|
|
|
}
|