mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
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:
@@ -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--) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user