mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28: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.
|
* @return a boolean.
|
||||||
*/
|
*/
|
||||||
public final String payMultipleMana(String mana) {
|
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, ' ')) {
|
for (String manaPart : TextUtil.split(mana, ' ')) {
|
||||||
if (StringUtils.isNumeric(manaPart)) {
|
if (StringUtils.isNumeric(manaPart)) {
|
||||||
for(int i = Integer.parseInt(manaPart); i > 0; i--) {
|
for(int i = Integer.parseInt(manaPart); i > 0; i--) {
|
||||||
|
|||||||
@@ -871,19 +871,11 @@ public class GameAction {
|
|||||||
final Comparator<StaticAbility> comp = new Comparator<StaticAbility>() {
|
final Comparator<StaticAbility> comp = new Comparator<StaticAbility>() {
|
||||||
@Override
|
@Override
|
||||||
public int compare(final StaticAbility a, final StaticAbility b) {
|
public int compare(final StaticAbility a, final StaticAbility b) {
|
||||||
if (a.getLayer() > b.getLayer()) {
|
int layerDelta = a.getLayer() - b.getLayer();
|
||||||
return 1;
|
if( layerDelta != 0) return layerDelta;
|
||||||
}
|
|
||||||
if (a.getLayer() < b.getLayer()) {
|
long tsDelta = a.getHostCard().getTimestamp() - b.getHostCard().getTimestamp();
|
||||||
return -1;
|
return tsDelta == 0 ? 0 : tsDelta > 0 ? 1 : -1;
|
||||||
}
|
|
||||||
if (a.getHostCard().getTimestamp() > b.getHostCard().getTimestamp()) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
if (a.getHostCard().getTimestamp() < b.getHostCard().getTimestamp()) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Collections.sort(staticAbilities, comp);
|
Collections.sort(staticAbilities, comp);
|
||||||
|
|||||||
@@ -1061,16 +1061,6 @@ public class Player extends GameEntity implements Comparable<Player> {
|
|||||||
return this.keywords;
|
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.
|
* Adds the keyword.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user