-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBlock.pm
64 lines (40 loc) · 964 Bytes
/
Block.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/perl
package Block;
use strict;
use warnings;
our $VERSION = 0.1;
our $AUTOLOAD;
sub new {
my ($class, %opts) = @_;
my $self = bless {}, $class;
$self->{x} = $opts{x} // 0;
$self->{y} = $opts{y} // 0;
$self->{w} = $opts{w} // 0;
$self->{h} = $opts{h} // 0;
$self->{v_x} = $opts{v_x} // 0;
$self->{v_y} = $opts{v_y} // 0;
return $self;
}
sub AUTOLOAD {
my ($self) = @_;
(my $c = $AUTOLOAD) =~ s/^.*:://;
return if ($c eq "DESTROY");
return $self->{$c} if ($self->{$c});
}
1;
__END__
=head1 NAME
Block -
=head1 VERSION
Version 0.1
=head1 SYNOPSIS
my $Block = Block->new(
);
=head1 DESCRIPTION
=head1 AUTHOR
Heikki MehtE<195>nen, C<< <[email protected]> >>
=head1 COPYRIGHT & LICENSE
Copyright 2010 Heikki MehtE<195>nen, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
=cut