Archived
1
0
Fork 0

Minor fixes.

This commit is contained in:
Henrik Hautakoski 2021-11-04 12:14:52 +01:00
parent ddf09fe00c
commit c8b93095dc
7 changed files with 26 additions and 32 deletions

View file

@ -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;