Mercurial > boosterpack
annotate Rule.pm @ 2:d7dd496a4fa6 boosterpack
[svn r4] actual functionality!
author | robert |
---|---|
date | Tue, 08 Sep 2009 02:45:26 -0400 |
parents | |
children | 8c6d2ce90677 |
rev | line source |
---|---|
robert@2 | 1 package Rule; |
robert@2 | 2 use List::Util qw(first max maxstr min minstr reduce shuffle sum); |
robert@2 | 3 |
robert@2 | 4 sub new |
robert@2 | 5 { |
robert@2 | 6 my $class = shift; |
robert@2 | 7 |
robert@2 | 8 my $hashREF = |
robert@2 | 9 { |
robert@2 | 10 _rarity_map => {"Rare" , 1 , "Uncommon" , 3 , "Common" , 6}, |
robert@2 | 11 _sets => ("Base Set") |
robert@2 | 12 |
robert@2 | 13 |
robert@2 | 14 |
robert@2 | 15 }; |
robert@2 | 16 |
robert@2 | 17 $objectREF = bless($hashREF, $class); |
robert@2 | 18 |
robert@2 | 19 return $objectREF; |
robert@2 | 20 |
robert@2 | 21 } |
robert@2 | 22 |
robert@2 | 23 |
robert@2 | 24 sub getRarityMap { return @_[0]->{'_rarity_map'}; }; |
robert@2 | 25 sub getSets { return @_[0]->{'_sets'}; } |
robert@2 | 26 |
robert@2 | 27 |
robert@2 | 28 sub setRarityMap { $_[0]->{_rarity_map} = $_[1]; } |
robert@2 | 29 sub setSets { $_[0]->{_sets} = $_[1]; } |
robert@2 | 30 |
robert@2 | 31 |
robert@2 | 32 1; |