X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FIronMunger%2FCalculate.pm;h=43b7fe01aa6fd2ce011cb3043940d5b717bee46e;hb=69941ee3552e918352c66954208ad46a914287ca;hp=ab01eca5bdc9e57de89fa40084aa03f7ba5ca4b9;hpb=0f2a44f932b5f01820b4f161c2f25fedf0a7e80f;p=engit%2FIron-Munger.git diff --git a/lib/IronMunger/Calculate.pm b/lib/IronMunger/Calculate.pm index ab01eca..43b7fe0 100644 --- a/lib/IronMunger/Calculate.pm +++ b/lib/IronMunger/Calculate.pm @@ -9,7 +9,7 @@ use signatures; use Sub::Exporter -setup => { exports => [ - qw(successful_sequential_posts days_remaining_to_post) + qw(successful_sequential_posts days_remaining_to_post level_for_post_count) ] }; @@ -64,4 +64,11 @@ sub days_remaining_to_post (@posts) { return check_both(\&check_time_remaining, @posts); } +sub level_for_post_count($count) { + return 'paper' if $count < 4; + return 'stone' if $count < 12; + return 'bronze' if $count < 36; + return 'iron'; +} + 1;