MCPcopy Create free account
hub / github.com/Card-Forge/forge / mergeTo

Method mergeTo

forge-game/src/main/java/forge/game/cost/Cost.java:966–978  ·  view source on GitHub ↗
(Cost source, int amt, final SpellAbility sa)

Source from the content-addressed store, hash-verified

964 }
965
966 public void mergeTo(Cost source, int amt, final SpellAbility sa) {
967 // multiply to create the full cost
968 if (amt > 1) {
969 // to double itself we need to work on a copy
970 Cost sourceCpy = source.copy();
971 for (int i = 1; i < amt; ++i) {
972 // in theory setAmount could be used instead but it depends on the cost complexity (probably not worth trying to determine that first)
973 source.add(sourceCpy);
974 }
975 }
976 // combine costs (these shouldn't mix together)
977 this.add(source, false, sa);
978 }
979
980 public Cost add(Cost cost1) {
981 return add(cost1, true);

Callers 2

resolveMethod · 0.95
applyRaiseCostAbilityMethod · 0.80

Calls 3

addMethod · 0.95
copyMethod · 0.65
addMethod · 0.65

Tested by

no test coverage detected