updated setText method for Cost to return itself

This commit is contained in:
Evan Kranzler 2021-08-06 20:57:34 -04:00
parent 7e66182974
commit 17100261e2
7 changed files with 24 additions and 15 deletions

View file

@ -1,10 +1,11 @@
package mage.abilities.costs;
import java.util.UUID;
import mage.abilities.Ability;
import mage.game.Game;
import mage.target.Targets;
import java.util.UUID;
public class CompositeCost implements Cost {
private final Cost firstCost;
@ -29,8 +30,9 @@ public class CompositeCost implements Cost {
}
@Override
public void setText(String text) {
public CompositeCost setText(String text) {
this.description = text;
return this;
}
@Override

View file

@ -14,7 +14,7 @@ public interface Cost extends Serializable, Copyable<Cost> {
String getText();
void setText(String text);
Cost setText(String text);
/**
* Check is it possible to pay

View file

@ -1,11 +1,12 @@
package mage.abilities.costs;
import java.util.UUID;
import mage.abilities.Ability;
import mage.game.Game;
import mage.target.Target;
import mage.target.Targets;
import java.util.UUID;
public abstract class CostImpl implements Cost {
protected UUID id;
@ -37,8 +38,9 @@ public abstract class CostImpl implements Cost {
}
@Override
public void setText(String text) {
public Cost setText(String text) {
this.text = text;
return this;
}
public void addTarget(Target target) {

View file

@ -1,18 +1,18 @@
package mage.abilities.costs;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.costs.mana.ManaCosts;
import mage.abilities.costs.mana.VariableManaCost;
import mage.game.Game;
import mage.target.Targets;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
* @param <T>
* @author BetaSteward_at_googlemail.com
*/
public class CostsImpl<T extends Cost> extends ArrayList<T> implements Costs<T> {
@ -34,8 +34,9 @@ public class CostsImpl<T extends Cost> extends ArrayList<T> implements Costs<T>
}
@Override
public void setText(String text) {
public CostsImpl<T> setText(String text) {
this.text = text;
return this;
}
@Override

View file

@ -1,7 +1,6 @@
package mage.abilities.costs;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.costs.mana.ManaCost;
import mage.constants.Outcome;
@ -9,6 +8,8 @@ import mage.game.Game;
import mage.players.Player;
import mage.target.Targets;
import java.util.UUID;
public class OrCost implements Cost {
private final Cost firstCost;
@ -36,8 +37,9 @@ public class OrCost implements Cost {
}
@Override
public void setText(String text) {
public OrCost setText(String text) {
this.description = text;
return this;
}
@Override

View file

@ -55,8 +55,9 @@ public abstract class VariableCostImpl implements Cost, VariableCost {
}
@Override
public void setText(String text) {
public VariableCostImpl setText(String text) {
this.text = text;
return this;
}
@Override

View file

@ -508,8 +508,9 @@ public class ManaCostsImpl<T extends ManaCost> extends ArrayList<T> implements M
}
@Override
public void setText(String text) {
public ManaCostsImpl<T> setText(String text) {
this.text = text;
return this;
}
@Override