01/09
2015
dev-master
9999999-devCasino simulation in PHP
MIT
The Requires
The Development Requires
by Derek McLean
Wallogit.com
2017 © Pedro Peláez
Casino simulation in PHP
Classes for simulating Casino games in PHP, (*1)
Install using composer:, (*2)
composer require delboy1978uk/casino
use Del\Casino();
$casino = new Casino();
$casino->createPlayer('Del',1000); // name, chips
$roulette = $casino->getRouletteTable();
$roulette->nextPlayersTurn()
->betRed(100)
->betSplit(31,34);
$results = $roulette->spinWheel();
__construct($decks);<br /> dealCard();<br /> discardCard(Card $card)<br /> shuffleDeck();<br /> getCardsRemaining();<br /> resetShoe();<br />
getSuit(); // eg. C, S, D, or H <br /> getValue(); // eg. A, K, Q, J, 10, 9, etc<br /> getAsText(); // eg. Ace of Spades<br /> getSuitAsText();<br /> getValueAsText();<br /> flipCard(); // toggles crd face up or face down flipFaceDown();<br /> flipFaceUp();<br /> isFaceDown();<br /> getHtml($id = null)<br /> getJson();<br />
__construct($id);<br /> getID();<br /> addCard(Card $card);<br /> removeCard($cardval); // The card as a shorthand string ie 10D<br /> addChips($amount);<br /> removeChips($amount);<br /> getBalance();<br />
__construct(Shoe $shoe, array $players);<br /> addPlayer(Player $player);<br /> removePlayer($id);<br /> getPlayers(); //returns an array object with iterator<br /> getNumPlayers();<br /> getBanker();<br /> setShoe(Shoe $shoe);<br /> addToPot($amount);<br /> removeFromPot($amount);<br /> getPotBalance();<br /> getHistory();<br />
Casino simulation in PHP
MIT