Mercurial > rlmcintyre
annotate BoosterPack/Rule.pm @ 0:0d795f02a8bb tip
initial committ. what was I thinking?
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Mon, 27 Sep 2010 16:57:26 -0400 |
parents | |
children |
rev | line source |
---|---|
rlm@0 | 1 package Rule; |
rlm@0 | 2 use List::Util qw(first max maxstr min minstr reduce shuffle sum); |
rlm@0 | 3 |
rlm@0 | 4 sub new |
rlm@0 | 5 { |
rlm@0 | 6 my $class = shift; |
rlm@0 | 7 |
rlm@0 | 8 my $hashREF = |
rlm@0 | 9 { |
rlm@0 | 10 _rarity_map => {"Rare" , 1 , "Uncommon" , 3 , "Common" , 6}, |
rlm@0 | 11 _sets => ("Base Set") |
rlm@0 | 12 |
rlm@0 | 13 |
rlm@0 | 14 |
rlm@0 | 15 }; |
rlm@0 | 16 |
rlm@0 | 17 $objectREF = bless($hashREF, $class); |
rlm@0 | 18 |
rlm@0 | 19 return $objectREF; |
rlm@0 | 20 |
rlm@0 | 21 } |
rlm@0 | 22 |
rlm@0 | 23 |
rlm@0 | 24 sub getRarityMap { return @_[0]->{'_rarity_map'}; }; |
rlm@0 | 25 sub getSets { return @_[0]->{'_sets'}; } |
rlm@0 | 26 |
rlm@0 | 27 |
rlm@0 | 28 sub setRarityMap { $_[0]->{_rarity_map} = $_[1]; } |
rlm@0 | 29 sub setSets { $_[0]->{_sets} = $_[1]; } |
rlm@0 | 30 |
rlm@0 | 31 |
rlm@0 | 32 1; |