Rydder i tester og kode

Fjerner en del unødvendige variabler i ProgrammingCardDeckTest
Forenkler shuffle testen vesentlig
Legger til en ekstra sjekk for integritet etter stokking av kort
Fjerner ICardWithoutSuit siden den legger til mer kompleksitet enn nytteverdi
This commit is contained in:
2020-03-03 20:51:50 +01:00
parent e4d6e49721
commit c207c56bca
4 changed files with 56 additions and 67 deletions

View File

@ -1,20 +0,0 @@
package inf112.fiasko.roborally.objects;
/**
* This Interface describes a card without a card suit
* @param <S> The value type
* @param <T> The symbol type
*/
public interface ICardWithoutSuit<S,T> {
/**
* Gets the value of the card
* @return The card value
*/
S getValue();
/**
* Gets the symbol of the card
* @return The card symbol
*/
T getSymbol();
}

View File

@ -5,9 +5,9 @@ import inf112.fiasko.roborally.element_properties.Action;
/**
* This class represents a programming card
*/
public class ProgrammingCard implements ICardWithoutSuit<Integer, Action> {
public class ProgrammingCard {
private final Integer cardValue;
private final int cardValue;
private final Action cardAction;
/**
@ -20,12 +20,18 @@ public class ProgrammingCard implements ICardWithoutSuit<Integer, Action> {
this.cardAction = cardAction;
}
@Override
public Integer getValue() {
/**
* Gets the value of the programming card
* @return The programming card value
*/
public int getValue() {
return cardValue;
}
@Override
/**
* Gets the symbol of the programming card
* @return The programming card symbol
*/
public Action getSymbol() {
return cardAction;
}