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

Method sort

forge-game/src/main/java/forge/game/cost/Cost.java:114–123  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

112 }
113
114 public void sort() {
115 // Things that need to happen first should be 0-4 (Tap, PayMana)
116 // Things that happen that are generally undoable 5 (Pretty much everything)
117 // Things that are annoying to undo 6-10 (PayLife, GainControl)
118 // Things that are hard to undo 11+ (Zone Changing things)
119 // Things that are pretty much happen at the end (Untap) 16+
120 // Things that NEED to happen last 100+
121
122 this.costParts.sort((o1, o2) -> ObjectUtils.compare(o1.paymentOrder(), o2.paymentOrder()));
123 }
124
125 /**
126 * Get the cost parts, always including a mana cost part (which may be

Callers 15

CostMethod · 0.95
addMethod · 0.95
CollectionMethod · 0.45
getBlockListMethod · 0.45
copyGameStateMethod · 0.45
stateBasedAction_RoleMethod · 0.45
payManaCostFromPoolMethod · 0.45
toStringMethod · 0.45
getSortedRequirementsMethod · 0.45
performTestMethod · 0.45

Calls 2

compareMethod · 0.45
paymentOrderMethod · 0.45

Tested by

no test coverage detected