mirror of
https://github.com/correl/mage.git
synced 2024-11-24 19:19:56 +00:00
* Added some basic logging for deck format validation
This commit is contained in:
parent
8b2445551e
commit
b12b044e36
3 changed files with 7 additions and 2 deletions
|
@ -283,7 +283,6 @@ public class TableController {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Player player = createPlayer(name, seat.getPlayerType(), skill);
|
||||
if (player == null) {
|
||||
String message = new StringBuilder("Could not create player ").append(name).append(" of type ").append(seat.getPlayerType()).toString();
|
||||
|
@ -291,6 +290,7 @@ public class TableController {
|
|||
user.showUserMessage("Join Table",message);
|
||||
return false;
|
||||
}
|
||||
logger.debug("DECK validated: " + table.getValidator().getName() + " " + player.getName() + " " + deck.getName());
|
||||
if (!player.canJoinTable(table)) {
|
||||
user.showUserMessage("Join Table", new StringBuilder("A ").append(seat.getPlayerType()).append(" player can't join this table.").toString());
|
||||
return false;
|
||||
|
|
|
@ -38,6 +38,7 @@ import mage.cards.Card;
|
|||
import mage.cards.repository.CardInfo;
|
||||
import mage.cards.repository.CardRepository;
|
||||
import mage.constants.Rarity;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -45,6 +46,8 @@ import mage.constants.Rarity;
|
|||
*/
|
||||
public class Constructed extends DeckValidator {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(DeckValidator.class);
|
||||
|
||||
protected List<String> banned = new ArrayList<>();
|
||||
protected List<String> restricted = new ArrayList<>();
|
||||
protected List<String> setCodes = new ArrayList<>();
|
||||
|
@ -60,6 +63,7 @@ public class Constructed extends DeckValidator {
|
|||
|
||||
@Override
|
||||
public boolean validate(Deck deck) {
|
||||
logger.debug("DECK validate start: " + name + " deckname: " + deck.getName() );
|
||||
boolean valid = true;
|
||||
//20091005 - 100.2a
|
||||
if (deck.getCards().size() < 60) {
|
||||
|
@ -153,7 +157,7 @@ public class Constructed extends DeckValidator {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
logger.debug("DECK validate end: " + name + " deckname: " + deck.getName() + " invalids:" + invalid.size());
|
||||
return valid;
|
||||
}
|
||||
|
||||
|
|
|
@ -62,6 +62,7 @@ sub toCamelCase {
|
|||
$string;
|
||||
}
|
||||
|
||||
# TODO: check for basic lands with ending 1,2,3,4,5 ...
|
||||
my $toPrint = '';
|
||||
foreach my $card (sort cardSort @setCards) {
|
||||
my $className = toCamelCase(@{$card}[0]);
|
||||
|
|
Loading…
Reference in a new issue