Mercurial > boosterpack
annotate Rule.pm @ 10:3b52ac950753 boosterpack tip
going to try to fix this thing
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Mon, 27 Sep 2010 17:24:06 -0400 |
parents | 8c6d2ce90677 |
children |
rev | line source |
---|---|
rlm@8 | 1 #!/usr/bin/perl |
rlm@8 | 2 |
rlm@8 | 3 package Rule; |
rlm@8 | 4 use List::Util qw(first max maxstr min minstr reduce shuffle sum); |
rlm@8 | 5 |
rlm@8 | 6 sub new |
rlm@8 | 7 { |
rlm@8 | 8 my $class = shift; |
rlm@8 | 9 |
rlm@8 | 10 my $hashREF = |
rlm@8 | 11 { |
rlm@8 | 12 _rarity_map => {"Rare" , 1 , "Uncommon" , 3 , "Common" , 6}, |
rlm@8 | 13 _sets => ("Base Set") |
rlm@8 | 14 |
rlm@8 | 15 |
rlm@8 | 16 |
rlm@8 | 17 }; |
rlm@8 | 18 |
rlm@8 | 19 $objectREF = bless($hashREF, $class); |
rlm@8 | 20 |
rlm@8 | 21 return $objectREF; |
rlm@8 | 22 |
rlm@8 | 23 } |
rlm@8 | 24 |
rlm@8 | 25 |
rlm@8 | 26 sub getRarityMap { return @_[0]->{'_rarity_map'}; }; |
rlm@8 | 27 sub getSets { return @_[0]->{'_sets'}; } |
rlm@8 | 28 |
rlm@8 | 29 |
rlm@8 | 30 sub setRarityMap { $_[0]->{_rarity_map} = $_[1]; } |
rlm@8 | 31 sub setSets { $_[0]->{_sets} = $_[1]; } |
rlm@8 | 32 |
rlm@8 | 33 |
rlm@8 | 34 1; |