Fixed bug in Perl script.

This commit is contained in:
LevelX2 2014-02-19 19:48:33 +01:00
parent 39e51cbf6c
commit 11618e64ba
2 changed files with 5 additions and 1 deletions

View file

@ -29,6 +29,7 @@ while(my $line = <DATA>) {
if ($data[1] eq $setName) { if ($data[1] eq $setName) {
push(@setCards, \@data); push(@setCards, \@data);
} }
}
close(DATA); close(DATA);
open (DATA, $knownSetsFile) || die "can't open $knownSetsFile"; open (DATA, $knownSetsFile) || die "can't open $knownSetsFile";
@ -63,6 +64,7 @@ sub toCamelCase {
my $cardsFound = 0; my $cardsFound = 0;
my $cardsImplemented = 0; my $cardsImplemented = 0;
my $toPrint = ''; my $toPrint = '';
foreach my $card (sort cardSort @setCards) { foreach my $card (sort cardSort @setCards) {
my $className = toCamelCase(@{$card}[0]); my $className = toCamelCase(@{$card}[0]);
my $currentFileName = "../Mage.Sets/src/mage/sets/" . $knownSets{$setName} . "/" . $className . ".java"; my $currentFileName = "../Mage.Sets/src/mage/sets/" . $knownSets{$setName} . "/" . $className . ".java";
@ -73,8 +75,9 @@ foreach my $card (sort cardSort @setCards) {
$toPrint .= "@{$card}[2]|@{$card}[0]"; $toPrint .= "@{$card}[2]|@{$card}[0]";
$cardsImplemented++; $cardsImplemented++;
} }
$cardsFound = $cardsFound + 1; $cardsFound++;
} }
print "Number of cards found for set " . $setName . ": " . $cardsFound . "\n"; print "Number of cards found for set " . $setName . ": " . $cardsFound . "\n";
print "Number of implemented cards: " . $cardsImplemented . "\n"; print "Number of implemented cards: " . $cardsImplemented . "\n";

View file

@ -73,6 +73,7 @@ foreach my $card (sort cardSort @setCards) {
$toPrint .= "@{$card}[2]|@{$card}[0]"; $toPrint .= "@{$card}[2]|@{$card}[0]";
} }
} }
open CARD, "> " . lc($sets{$setName}) ."_unimplemented.txt"; open CARD, "> " . lc($sets{$setName}) ."_unimplemented.txt";
print CARD $toPrint; print CARD $toPrint;
close CARD; close CARD;