1
0
Fork 0
wow-raid-bingo/app/Game/GameService.php
2021-11-04 12:14:52 +01:00

42 lines
757 B
PHP

<?php
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
{
return $this->session;
}
/**
* Generate a new Game session
*/
public function newSession(?GameSettings $settings = null) : self
{
if (!$settings) {
$settings = $this->session()->getSettings();
}
// Generate a new board
$this->session->getBoard()->regenerate($settings);
return $this;
}
}