1 | #!/opt/bin/perl |
1 | #!/opt/bin/perl |
2 | |
2 | |
3 | # usage: res2pm |
3 | # usage: res2pm |
4 | |
4 | |
5 | open STDOUT, ">:utf8", "Crossfire/Data.pm" |
5 | open STDOUT, ">:utf8", "Deliantra/Data.pm" |
6 | or die "Crossfire/Data.pm: $!"; |
6 | or die "Deliantra/Data.pm: $!"; |
7 | |
7 | |
8 | print <<EOF; |
8 | print <<EOF; |
9 | =head1 NAME |
9 | =head1 NAME |
10 | |
10 | |
11 | Crossfire::Data - various data structures useful for understanding archs and objects |
11 | Deliantra::Data - various data structures useful for understanding archs and objects |
12 | |
12 | |
13 | =head1 |
13 | =head1 |
14 | |
14 | |
15 | THIS FILE IS AUTOGENERATED, DO NOT EDIT! |
15 | THIS FILE IS AUTOGENERATED, DO NOT EDIT! |
16 | |
16 | |
… | |
… | |
22 | |
22 | |
23 | See F<res/README> for more info. |
23 | See F<res/README> for more info. |
24 | |
24 | |
25 | =cut |
25 | =cut |
26 | |
26 | |
27 | package Crossfire::Data; |
27 | package Deliantra::Data; |
28 | |
28 | |
29 | EOF |
29 | EOF |
30 | |
30 | |
31 | use Data::Dumper; |
31 | use Data::Dumper; |
32 | use XML::Grove::Builder; |
32 | use XML::Grove::Builder; |
… | |
… | |
130 | } elsif ($e->{Name} eq "ignore") { |
130 | } elsif ($e->{Name} eq "ignore") { |
131 | for my $i (grep $_->isa ('XML::Grove::Element'), @{$e->{Contents}}) { |
131 | for my $i (grep $_->isa ('XML::Grove::Element'), @{$e->{Contents}}) { |
132 | if ($i->{Name} eq "ignore_list") { |
132 | if ($i->{Name} eq "ignore_list") { |
133 | push @{$type->{ignore}}, $ignore_list{$i->{Attributes}->{name}} ||= []; |
133 | push @{$type->{ignore}}, $ignore_list{$i->{Attributes}->{name}} ||= []; |
134 | } elsif ($i->{Name} eq "attribute") { |
134 | } elsif ($i->{Name} eq "attribute") { |
|
|
135 | warn "ACDD $i->{Attributes}->{arch}\n"; |
135 | push @{$type->{ignore}}, $i->{Attributes}->{arch}; |
136 | push @{$type->{ignore}}, [$i->{Attributes}->{arch}]; |
136 | } |
137 | } |
137 | } |
138 | } |
138 | } elsif ($e->{Name} eq "import_type") { |
139 | } elsif ($e->{Name} eq "import_type") { |
139 | #push @{$type->{import}}, $type{$e->{Attributes}->{name}} ||= {}; |
140 | #push @{$type->{import}}, $type{$e->{Attributes}->{name}} ||= {}; |
140 | push @{$type->{import}}, $e->{Attributes}->{name}; |
141 | push @{$type->{import}}, $e->{Attributes}->{name}; |