Added planes deck section to nonCardToken recognition (left out by mistake)

Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
This commit is contained in:
leriomaggio
2021-09-12 11:06:07 +01:00
parent 95f1d6df07
commit 014783dfbe
2 changed files with 15 additions and 1 deletions

View File

@@ -100,6 +100,8 @@ public class DeckRecognizer {
return new Token(TokenType.DECK_SECTION_NAME, DeckSection.Schemes.name());
if (sectionName.equals("conspiracy"))
return new Token(TokenType.DECK_SECTION_NAME, DeckSection.Conspiracy.name());
if (sectionName.equals("planes"))
return new Token(TokenType.DECK_SECTION_NAME, DeckSection.Planes.name());
return null;
}
@@ -136,6 +138,12 @@ public class DeckRecognizer {
public final int getNumber() {
return this.number;
}
public boolean isCardToken() {
return (this.type == TokenType.LEGAL_CARD_REQUEST ||
this.type == TokenType.ILLEGAL_CARD_REQUEST ||
this.type == TokenType.INVALID_CARD_REQUEST );
}
}
// Utility Constants

View File

@@ -210,7 +210,7 @@ public class DeckRecognizerTest extends ForgeCardMockTestCase {
@Test void testMatchDeckSectionNames(){
String[] dckSections = new String[] {"Main", "main", "Mainboard",
"Sideboard", "Side", "Schemes", "Avatar", "avatar", "Commander", "Conspiracy", "card"};
"Sideboard", "Side", "Schemes", "Avatar", "avatar", "Commander", "Conspiracy", "card", "Planes"};
for (String section : dckSections)
assertTrue(DeckRecognizer.isDeckSectionName(section), "Unrecognised Deck Section: " + section);
@@ -381,6 +381,12 @@ public class DeckRecognizerTest extends ForgeCardMockTestCase {
assertEquals(t.getType(), TokenType.MANA_COLOUR);
assertEquals(t.getText(), "Colorless");
assertEquals(t.getNumber(), 0);
t = recognizer.recogniseNonCardToken("//Planes");
assertNotNull(t);
assertEquals(t.getType(), TokenType.DECK_SECTION_NAME);
assertEquals(t.getText(), "Planes");
assertEquals(t.getNumber(), 0);
}
/*=============================