mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 02:08:00 +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(){
|
||||
if (this.isCardToken())
|
||||
if (this.isCardToken()) {
|
||||
if (this.tokenSection != null)
|
||||
return String.format("%s-%s-%s-%s-%s",
|
||||
this.card.getName(), this.card.getEdition(),
|
||||
this.card.getCollectorNumber(),
|
||||
this.tokenSection.name(), this.getType().name().toLowerCase());
|
||||
return "";
|
||||
this.getType().name().toLowerCase(),
|
||||
this.tokenSection.name());
|
||||
return String.format("%s-%s-%s-%s",
|
||||
this.card.getName(), this.card.getEdition(),
|
||||
this.card.getCollectorNumber(),
|
||||
this.getType().name().toLowerCase());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static class TokenKey {
|
||||
@@ -171,8 +178,11 @@ public class DeckRecognizer {
|
||||
tokenKey.cardName = keyInfo[0];
|
||||
tokenKey.setCode = keyInfo[1];
|
||||
tokenKey.collectorNumber = keyInfo[2];
|
||||
tokenKey.typeName = keyInfo[3];
|
||||
if (keyInfo.length > 4)
|
||||
tokenKey.deckSection = keyInfo[3];
|
||||
tokenKey.typeName = keyInfo[4];
|
||||
else
|
||||
tokenKey.deckSection = null;
|
||||
return tokenKey;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user