package de.fhdw.gaming.ipspiel21.dilemmaOriginal.strategy;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Optional;
import java.util.Set;
import de.fhdw.gaming.core.domain.GameException;
import de.fhdw.gaming.ipspiel21.dilemmaOriginal.domain.DilemmaPlayer;
import de.fhdw.gaming.ipspiel21.dilemmaOriginal.domain.DilemmaState;
import de.fhdw.gaming.ipspiel21.dilemmaOriginal.domain.DilemmaStrategy;
import de.fhdw.gaming.ipspiel21.dilemmaOriginal.moves.DilemmaMove;
import de.fhdw.gaming.ipspiel21.dilemmaOriginal.moves.factory.DilemmaMoveFactory;
import de.fhdw.gaming.ipspiel21.dilemmaOriginal.moves.impl.DilemmaBeSilentMove;
import de.fhdw.gaming.ipspiel21.dilemmaOriginal.moves.impl.DilemmaConfessMove;
/**
* Implements {@link DilemmaStrategy} by saying that what was set before the game started.
*/
public final class DilemmaCustomStrategy implements DilemmaStrategy {
/**
* Constant that represents the identifier when the opponent moves are {@link DilemmaConfessMove) for 100 percent.
*/
private static final String IDENTIFIER_100_CONFESS = new DilemmaConfessMove().toString() + " Numberbased100";
/**
* Constant that represents the identifier when the opponent moves are {@link DilemmaConfessMove) for >50 percent.
*/
private static final String IDENTIFIER_50_CONFESS = new DilemmaConfessMove().toString() + " Numberbased50";
/**
* Constant that represents the identifier when the opponent moves are {@link DilemmaBeSilentMove) for 100 percent.
*/
private static final String IDENTIFIER_100_BESILENT = new DilemmaBeSilentMove().toString() + " Numberbased100";
/**
* Constant that represents the identifier when the opponent moves are {@link DilemmaBeSilentMove) for >50 percent.
*/
private static final String IDENTIFIER_50_BESILENT = new DilemmaBeSilentMove().toString() + " Numberbased50";
/**
* The provided Data.
*/
private Map<String, DilemmaMove> providedMoveData;
/**
* Amount of considered games.
*/
private Integer amountOfGames;
/**
* Default move of player.
*/
private DilemmaMove initialMove;
/**
* The factory for creating Dilemma moves.
*/
private final DilemmaMoveFactory moveFactory;
Avoid unused private fields such as 'moveFactory'.
Detects when a private field is declared and/or assigned a value, but not used.
Since PMD 6.50.0 private fields are ignored, if the fields are annotated with any annotation or the
enclosing class has any annotation. Annotations often enable a framework (such as dependency injection, mocking
or e.g. Lombok) which use the fields by reflection or other means. This usage can't be detected by static code analysis.
Previously these frameworks where explicitly allowed by listing their annotations in the property
"ignoredAnnotations", but that turned out to be prone of false positive for any not explicitly considered framework.
public class Something {
private static int FOO = 2; // Unused
private int i = 5; // Unused
private int j = 6;
public int addOne() {
return j++;
}
}