line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Chess::FIDE::Player; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
37834
|
use 5.008; |
|
3
|
|
|
|
|
13
|
|
|
3
|
|
|
|
|
124
|
|
4
|
3
|
|
|
3
|
|
16
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
98
|
|
5
|
3
|
|
|
3
|
|
17
|
use warnings; |
|
3
|
|
|
|
|
11
|
|
|
3
|
|
|
|
|
86
|
|
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
15
|
use Exporter; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
455
|
|
8
|
3
|
|
|
3
|
|
18
|
use Carp; |
|
3
|
|
|
|
|
14
|
|
|
3
|
|
|
|
|
1758
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our @FIDE_field = qw( |
13
|
|
|
|
|
|
|
id surname givenname name title federation rating games year flags |
14
|
|
|
|
|
|
|
); |
15
|
|
|
|
|
|
|
our @FIDE_default = ( |
16
|
|
|
|
|
|
|
0, '', '', '', '', '', 0, 0, 0, '' |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
our @EXPORT = qw(@FIDE_field); |
19
|
|
|
|
|
|
|
our $AUTOLOAD; |
20
|
|
|
|
|
|
|
our $VERSION = '1.10'; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub new ($;@) { |
23
|
|
|
|
|
|
|
|
24
|
472436
|
|
|
472436
|
0
|
599660
|
my $self = shift; |
25
|
472436
|
|
33
|
|
|
1699308
|
my $class = ref($self) || $self; |
26
|
472436
|
|
|
|
|
1660063
|
my %param = @_; |
27
|
|
|
|
|
|
|
|
28
|
472436
|
|
|
|
|
759116
|
my $player = {}; |
29
|
472436
|
|
|
|
|
1155975
|
bless $player,$class; |
30
|
472436
|
|
|
|
|
538099
|
my $f = 0; |
31
|
472436
|
|
|
|
|
858332
|
for (@FIDE_field) { |
32
|
4724360
|
|
66
|
|
|
31523055
|
$player->{$_} = $param{$_} || $FIDE_default[$f]; |
33
|
4724360
|
|
|
|
|
8570110
|
$f++; |
34
|
|
|
|
|
|
|
} |
35
|
472436
|
|
|
|
|
1841470
|
return $player; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub AUTOLOAD ($;$) { |
39
|
|
|
|
|
|
|
|
40
|
2882666
|
|
|
2882666
|
|
7152121
|
my $self = shift; |
41
|
2882666
|
|
|
|
|
3284254
|
my $param = shift; |
42
|
|
|
|
|
|
|
|
43
|
2882666
|
|
|
|
|
3335289
|
my $method = $AUTOLOAD; |
44
|
2882666
|
|
|
|
|
3894691
|
$method = lc $method; |
45
|
2882666
|
|
|
|
|
13073023
|
my @path = split(/\:\:/, $method); |
46
|
2882666
|
|
|
|
|
4018565
|
$method = pop @path; |
47
|
2882666
|
50
|
|
|
|
6183745
|
return if $method =~ /^destroy$/; |
48
|
2882666
|
100
|
|
|
|
6258321
|
unless (exists $self->{$method}) { |
49
|
2
|
|
|
|
|
343
|
carp "No such method or property $method"; |
50
|
2
|
|
|
|
|
262
|
return undef; |
51
|
|
|
|
|
|
|
} |
52
|
2882664
|
100
|
|
|
|
5472687
|
$self->{$method} = $param if ($param); |
53
|
2882664
|
|
|
|
|
9609630
|
return $self->{$method}; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
# Preloaded methods go here. |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
1; |
59
|
|
|
|
|
|
|
__END__ |