mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
Added planes deck section to nonCardToken recognition (left out by mistake)
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
/*=============================
|
||||
|
||||
Reference in New Issue
Block a user