Created
June 7, 2015 23:49
-
-
Save josephjaniga/f78fa1c4717d1aa6e2ae to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Player implements CanPlayBlackJack | |
{ | |
protected $hands = []; | |
protected $activeHand = 0; | |
protected $conreteStrategy; // strategyInterface | |
function __construct() | |
{ | |
array_push($this->hands, new Hand()); | |
} | |
public function addToHand(Card $card) | |
{ | |
$this->hands[$this->activeHand]->addCard($card); | |
} | |
public function chooseAction($status) | |
{ | |
return $concreteStrategy->determineAction($status); | |
//return BlackJackGame::ACTION_STAND; | |
} | |
public function discardAllFromHands() | |
{ | |
unset($this->hands); | |
$this->hands = []; | |
array_push($this->hands, new Hand()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hola