spjspj - Do a count for supertypes and subtypes of all implemented cards.

This commit is contained in:
spjspj 2016-10-16 22:03:20 +11:00
parent 391bf4bfc3
commit 6029cbfd8d
2 changed files with 59 additions and 2 deletions

View file

@ -744,8 +744,8 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg
sortButton = new JButton("Sort");
filterButton = new JButton("Filter");
visibilityButton = new JButton("Visibility");
selectByButton = new JButton("Select By ..");
analyseButton = new JButton("Analyse Mana");
selectByButton = new JButton("Select By");
analyseButton = new JButton("Mana");
// Name and count label
deckNameAndCountLabel = new JLabel();

57
Utils/gen_types_list.pl Normal file
View file

@ -0,0 +1,57 @@
#!/usr/bin/perl -w
##
# File: gen_types_list.pl
# Author: spjspj
# Purpose: To open all card java files and work out if any have duplicate cardNumber / expansionSetCode
##
use strict;
use Scalar::Util qw(looks_like_number);
my $dir_listing = "dir \/a \/b \/s ..\\Mage.Sets\\ | find \".java\" |";
open (DIR_LISTING, "$dir_listing");
my %types;
my %types_files;
while (<DIR_LISTING>)
{
chomp;
my $file = $_;
my $name = "";
my $cardNum = "";
open (JAVA_FILE, "$file");
while (<JAVA_FILE>)
{
chomp;
# Eg: this.subtype.add("Human");
my $line = $_;
if ($line =~ m/this.subtype.add.*"([^"]*)".;/)
{
$types{$1}++;
$types_files{$1} .= $file . ",,,";
}
if ($line =~ m/this.supertype.add.*"([^"]*)"/)
{
$types{$1}++;
$types_files{$1} .= $file . ",,,";
}
}
close (JAVA_FILE);
}
my $key;
foreach $key (sort keys (%types))
{
print ("$types{$key} = $key .... ");
if ($types{$key} < 10)
{
print (" In files:$types_files{$key}");
}
print ("\n");
}