remove diamond operator in ManaCostBeingPaid

remove setKeywords from Player (the method was never referenced and has been added by checkstyle enforcing)
compare static abilities - a slight optimization
This commit is contained in:
Maxmtg
2013-05-18 05:23:40 +00:00
parent 3eb6701e0a
commit 1d4b6cc88a
3 changed files with 6 additions and 24 deletions

View File

@@ -235,7 +235,7 @@ public class ManaCostBeingPaid {
* @return a boolean.
*/
public final String payMultipleMana(String mana) {
List<String> unused = new ArrayList<>(4);
List<String> unused = new ArrayList<String>(4);
for (String manaPart : TextUtil.split(mana, ' ')) {
if (StringUtils.isNumeric(manaPart)) {
for(int i = Integer.parseInt(manaPart); i > 0; i--) {

View File

@@ -871,19 +871,11 @@ public class GameAction {
final Comparator<StaticAbility> comp = new Comparator<StaticAbility>() {
@Override
public int compare(final StaticAbility a, final StaticAbility b) {
if (a.getLayer() > b.getLayer()) {
return 1;
}
if (a.getLayer() < b.getLayer()) {
return -1;
}
if (a.getHostCard().getTimestamp() > b.getHostCard().getTimestamp()) {
return 1;
}
if (a.getHostCard().getTimestamp() < b.getHostCard().getTimestamp()) {
return -1;
}
return 0;
int layerDelta = a.getLayer() - b.getLayer();
if( layerDelta != 0) return layerDelta;
long tsDelta = a.getHostCard().getTimestamp() - b.getHostCard().getTimestamp();
return tsDelta == 0 ? 0 : tsDelta > 0 ? 1 : -1;
}
};
Collections.sort(staticAbilities, comp);

View File

@@ -1061,16 +1061,6 @@ public class Player extends GameEntity implements Comparable<Player> {
return this.keywords;
}
/**
* Sets the keywords.
*
* @param keywords
* the new keywords
*/
public final void setKeywords(final ArrayList<String> keywords) {
this.keywords = keywords;
}
/**
* Adds the keyword.
*