name = $name; $this->config = $config; array_push($this->hands, $hand); } public function GetName() { return $this->name; } public function GetHands() { return $this->hands; } protected function ValidateHandIndex($index) { //Hands can be deleted too when it has lost. if(!array_key_exists($index, $this->hands)) return new Error(E_BJ_HAND_BAD_INDEX); return true; } public function Hit($handIndex, Card $card) { $isHandValid = $this->ValidateHandIndex($handIndex); if($isHandValid instanceof Error) return $isHandValid; return $this->hands[$handIndex]->AddCard($card); } }