Skip to content

Instantly share code, notes, and snippets.

@josephjaniga josephjaniga/player
Created Jun 7, 2015

Embed
What would you like to do?
<?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());
}
}
@IronCollectionMilkshake

This comment has been minimized.

Copy link

IronCollectionMilkshake commented Jun 7, 2015

hola

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.