Games::Dice::Result - what you get when you roll some dice
$Id: Result.pm 1499 2007-07-29 19:15:29Z rjbs $
my $dice = Games::Dice->new("3d6"); my $result = $dice->roll; say "You rolled: ", $result->as_string;
Result objects are returned when the
roll method is called on a Game::Dice set.
my $result = Games::Dice::Result->new(\%arg);
This method creates a new result. You shouldn't need to use it outside of Games::Dice classes.
Valid arguments are:
results - (required) an arrayref of Games::Die::Result objects dropped - (optional) an arrayref of Games::Die::Result objects adjust - (optional) a coderef
This method returns all the non-dropped Games::Die::Result objects for this result.
This returns a list of the result of each die rolled, in the order the results were given to the constructor.
This returns both kept and dropped die results for this object.
This returns the total of the rolls, plus the adjustment.
This method returns a string describing the results. The default implementation will return something like this (though this is likely to change):
1 + 2 + 4 + 4 + 8 = 19 + 2 = 21
Ricardo SIGNES, <
Please report any bugs or feature requests to
email@example.com, or through the web interface at http://rt.cpan.org. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
Copyright 2005, Ricardo SIGNES.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.