package ffg.game.vs;
import ffg.gui.table.column.FFGTableColumn;
import ffg.gui.table.column.IntegerColumnInfo;
import ffg.gui.table.renderer.PriceChangeTableCellRendererDecorator;
/**
* Column representing the amount a player will rise given he scores x in the next round.
* @author eugeneh
* @param <E> Subclass of {@link VSGameStats}
*/
public class IfScoreTableColumn<E extends VSGameStats> extends FFGTableColumn<E, Integer> {
private final int score;
/**
* Creates a new instance of IfScoreTableColumn
* @param score the score
*/
public IfScoreTableColumn(int score) {
super("If " + score, IntegerColumnInfo.REVERSE_INSTANCE, PriceChangeTableCellRendererDecorator.INSTANCE);
this.score = score;
}
public boolean isFilterable() {
return true;
}
public Integer getObjectValue(E baseObject) {
return baseObject.changeFromScore(score);
}
}
|