Archived
1
0
Fork 0

Initial Commit

This commit is contained in:
Henrik Hautakoski 2021-10-18 11:53:33 +02:00
commit ddf09fe00c
113 changed files with 187148 additions and 0 deletions

36
app/Game/GameService.php Normal file
View file

@ -0,0 +1,36 @@
<?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;
}
}