WordPress
- 4 ответа
- 0 вопросов
2
Вклад в тег
IBehavior
- public function calculate($data);
WinnerFirstBehavior implements IBehavior
WinnerFirstSecondBehavior ...
DrawFirstSecondBehavior ...
DrawSecondThirdBehavior ...
DrawAllBehavior ...
class Player
{
private $behavior;
private $score;
public function __construct(IBehavior $behavior, $score)
{
$this->behavior = $behavior;
$this->score = $score;
}
public function calculate()
{
return $this->behavior->calculate($this->score);
}
}