\Rasb14\T100DiceHand

DiceHand, a class representing a hand with dices.

Summary

Methods
Properties
Constants
__construct()
roll()
values()
sum()
average()
anyDieHasValue()
graphic()
htmlHistogram()
histogram()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$dices
N/A

Properties

$dices

$dices : array

Type

array — The DiceHands Dices.

Methods

__construct()

__construct(integer  $dices) 

Constructor to create a Dice.

Parameters

integer $dices

The number of dices of the DiceHand.

roll()

roll() : \Rasb14\T100\void.

Roll all dices.

Returns

\Rasb14\T100\void.

values()

values() : array

Get values of dices from last roll.

Returns

array —

with values of the last roll.

sum()

sum() : integer

Get the sum of all dices.

Returns

integer —

as the sum of all dices.

average()

average() : float

Get the average of all dices.

Returns

float —

as the average of all dices.

anyDieHasValue()

anyDieHasValue(integer  $value) : boolean

Checks if any dice currently has the specified value.

Parameters

integer $value

The value to add.

Returns

boolean —

as some die has the specified value.

graphic()

graphic() : array

Gets the graphics for the dices.

Returns

array —

as graphics.

htmlHistogram()

htmlHistogram() : string

Gets the histogram for the dices.

Returns

string —

as an html ul list.

histogram()

histogram() : array

Gets the histogram for the dices.

Returns

array —

as a sorted histogram array.