Minor fixes.
This commit is contained in:
parent
ddf09fe00c
commit
c8b93095dc
7 changed files with 26 additions and 32 deletions
|
|
@ -4,15 +4,21 @@ namespace App\Game;
|
|||
|
||||
class GameService
|
||||
{
|
||||
/**
|
||||
* The game session
|
||||
*/
|
||||
protected GameSession $session;
|
||||
|
||||
/**
|
||||
* Construct a new Game Service
|
||||
*/
|
||||
public function __construct(GameSession $session)
|
||||
{
|
||||
$this->session = $session;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Get the current session
|
||||
*/
|
||||
public function session() : GameSession
|
||||
{
|
||||
|
|
@ -24,11 +30,11 @@ class GameService
|
|||
*/
|
||||
public function newSession(?GameSettings $settings = null) : self
|
||||
{
|
||||
// Generate new cards
|
||||
if (!$settings) {
|
||||
$settings = $this->session()->getSettings();
|
||||
}
|
||||
|
||||
// Generate a new board
|
||||
$this->session->getBoard()->regenerate($settings);
|
||||
|
||||
return $this;
|
||||
|
|
|
|||
Reference in a new issue