Code cleanup: protect all copy constructors (#10750)

* apply regex to change public copy constructors to protected
* cleanup code using now protected constructors
* fix manaBuilder weird casting of Mana into ConditionalMana
This commit is contained in:
Susucre 2023-08-05 01:34:58 +02:00 committed by GitHub
parent b04b13d530
commit f75b1c9f0a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1565 changed files with 2412 additions and 2731 deletions

View file

@ -15,7 +15,6 @@ import mage.players.Player;
import mage.util.CardUtil;
/**
*
* @author MarcoMarin
*/
public class DoUnlessControllerPaysEffect extends OneShotEffect {
@ -35,7 +34,7 @@ public class DoUnlessControllerPaysEffect extends OneShotEffect {
this.chooseUseText = chooseUseText;
}
public DoUnlessControllerPaysEffect(final DoUnlessControllerPaysEffect effect) {
protected DoUnlessControllerPaysEffect(final DoUnlessControllerPaysEffect effect) {
super(effect);
this.executingEffects = effect.executingEffects.copy();
this.cost = effect.cost.copy();
@ -61,7 +60,7 @@ public class DoUnlessControllerPaysEffect extends OneShotEffect {
message = CardUtil.replaceSourceName(message, sourceObject.getName());
boolean result = true;
boolean doEffect = true;
// check if controller is willing to pay
if (cost.canPay(source, source, controller.getId(), game) && controller.chooseUse(Outcome.Detriment, message, source, game)) {
cost.clearPaid();
@ -69,7 +68,7 @@ public class DoUnlessControllerPaysEffect extends OneShotEffect {
if (!game.isSimulation()) {
game.informPlayers(controller.getLogName() + " pays the cost to prevent the effect");
}
doEffect = false;
doEffect = false;
}
}