1
0
Fork 0
wow-raid-bingo/app/Game/GameService.php
2021-10-18 11:56:52 +02:00

36 lines
639 B
PHP

<?php
namespace App\Game;
class GameService
{
protected GameSession $session;
public function __construct(GameSession $session)
{
$this->session = $session;
}
/**
*
*/
public function session() : GameSession
{
return $this->session;
}
/**
* Generate a new Game session
*/
public function newSession(?GameSettings $settings = null) : self
{
// Generate new cards
if (!$settings) {
$settings = $this->session()->getSettings();
}
$this->session->getBoard()->regenerate($settings);
return $this;
}
}