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

Method addTokenInSet

forge-core/src/main/java/forge/token/TokenDb.java:95–105  ·  view source on GitHub ↗
(CardEdition edition, String name, CardEdition.EditionEntry t)

Source from the content-addressed store, hash-verified

93 }
94
95 protected PaperToken addTokenInSet(CardEdition edition, String name, CardEdition.EditionEntry t) {
96 CardRules rules;
97 if (rulesByName.containsKey(name)) {
98 rules = rulesByName.get(name);
99 } else if ("w_2_2_spirit".equals(name) || "w_3_3_spirit".equals(name)) { // Hotfix for Endure Token
100 rules = rulesByName.get("w_x_x_spirit");
101 } else {
102 throw new RuntimeException("wrong token name:" + name);
103 }
104 return new PaperToken(rules, edition, name, t.collectorNumber(), t.artistName());
105 }
106
107 // Null filter: historical first-alphabetical match. Non-null: random among
108 // editions that register the token and pass the filter, or null if none.

Callers 2

preloadTokensMethod · 0.95
loadTokenFromSetMethod · 0.95

Calls 3

containsKeyMethod · 0.80
getMethod · 0.65
equalsMethod · 0.45

Tested by

no test coverage detected