Advertisement
repente

Untitled

Jun 19th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. <?php
  2.  
  3. namespace Mos\Dice;
  4.  
  5. /**
  6. * A dice which has the ability to show a histogram.
  7. */
  8. class DiceHistogram extends Dice
  9. {
  10. use HistogramTrait;
  11.  
  12.  
  13.  
  14. /**
  15. * Roll the dice, remember its value in the serie and return
  16. * its value.
  17. *
  18. * @return int the value of the rolled dice.
  19. */
  20. public function roll()
  21. {
  22. $this->serie[] = parent::roll();
  23. return $this->getLastRoll();
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement