\Rasb14\T100Game

Game class for managing game data.

Summary

Methods
Properties
Constants
__construct()
doRoll()
winner()
graphic()
currentUnsaved()
htmlHistogram()
generateStandingsTable()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
runAi()
aiShouldSave()
$player
$ai
$dices
$diceHand
N/A

Properties

$ai

$ai : 

Type

$dices

$dices : 

Type

$diceHand

$diceHand : 

Type

Methods

__construct()

__construct(integer  $dices, string  $playerName) 

Constructor to create the Game class.

Parameters

integer $dices

The number of dices to use.

string $playerName

The name of the human player.

doRoll()

doRoll(boolean  $save) 

Processes a turn, making a roll for the player.

Parameters

boolean $save

Tells the function if it should save the current unsaved points for the player.

winner()

winner() : string

Checks if there is a winner.

Returns

string —

as winner or null if there is no winner yet.

graphic()

graphic() : array

Returns the graphic specs for the current dices in the diceHand.

Returns

array —

as the graphics.

currentUnsaved()

currentUnsaved() : integer

Gets the unsaved points of a player.

Returns

integer —

as the number of unsaved points.

htmlHistogram()

htmlHistogram() : string

Gets the histogram for the current dicehand.

Returns

string —

as html representing the histogram.

generateStandingsTable()

generateStandingsTable() : string

Generates the standings table.

Returns

string —

as the standings table.

runAi()

runAi() : void

Runs the AI scruipt.

aiShouldSave()

aiShouldSave() : boolean

Calculates if AI should save.

Returns

boolean —

as should save.