mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 10:18:01 +00:00
FIX incorporating tokenKey with tokenSection if Any
(tokenSection is null for non-legal-card-type token) Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
This commit is contained in:
@@ -149,12 +149,19 @@ public class DeckRecognizer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getKey(){
|
public String getKey(){
|
||||||
if (this.isCardToken())
|
if (this.isCardToken()) {
|
||||||
return String.format("%s-%s-%s-%s-%s",
|
if (this.tokenSection != null)
|
||||||
|
return String.format("%s-%s-%s-%s-%s",
|
||||||
|
this.card.getName(), this.card.getEdition(),
|
||||||
|
this.card.getCollectorNumber(),
|
||||||
|
this.getType().name().toLowerCase(),
|
||||||
|
this.tokenSection.name());
|
||||||
|
return String.format("%s-%s-%s-%s",
|
||||||
this.card.getName(), this.card.getEdition(),
|
this.card.getName(), this.card.getEdition(),
|
||||||
this.card.getCollectorNumber(),
|
this.card.getCollectorNumber(),
|
||||||
this.tokenSection.name(), this.getType().name().toLowerCase());
|
this.getType().name().toLowerCase());
|
||||||
return "";
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class TokenKey {
|
public static class TokenKey {
|
||||||
@@ -171,8 +178,11 @@ public class DeckRecognizer {
|
|||||||
tokenKey.cardName = keyInfo[0];
|
tokenKey.cardName = keyInfo[0];
|
||||||
tokenKey.setCode = keyInfo[1];
|
tokenKey.setCode = keyInfo[1];
|
||||||
tokenKey.collectorNumber = keyInfo[2];
|
tokenKey.collectorNumber = keyInfo[2];
|
||||||
tokenKey.deckSection = keyInfo[3];
|
tokenKey.typeName = keyInfo[3];
|
||||||
tokenKey.typeName = keyInfo[4];
|
if (keyInfo.length > 4)
|
||||||
|
tokenKey.deckSection = keyInfo[3];
|
||||||
|
else
|
||||||
|
tokenKey.deckSection = null;
|
||||||
return tokenKey;
|
return tokenKey;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user