69 lines
1 KiB
PHP
69 lines
1 KiB
PHP
<?php
|
|
|
|
namespace App\Game;
|
|
|
|
use Illuminate\Support\Collection;
|
|
|
|
class GameSession
|
|
{
|
|
/**
|
|
* The Game Board
|
|
*/
|
|
protected GameBoard $board;
|
|
|
|
/**
|
|
* Game settings for this session.
|
|
*/
|
|
protected GameSettings $settings;
|
|
|
|
/**
|
|
*
|
|
*/
|
|
//protected $cards;
|
|
|
|
public function __construct(GameBoard $board, GameSettings $settings)
|
|
{
|
|
$this->board = $board;
|
|
$this->settings = $settings;
|
|
}
|
|
|
|
/**
|
|
*
|
|
*/
|
|
public function getBoard() : GameBoard
|
|
{
|
|
return $this->board;
|
|
}
|
|
|
|
/**
|
|
*
|
|
*/
|
|
public function getBoardState() : GameBoardState
|
|
{
|
|
return $this->getBoard()->getState();
|
|
}
|
|
|
|
/**
|
|
*
|
|
*/
|
|
public function getCards() : Collection
|
|
{
|
|
return $this->getBoard()->getCards();
|
|
}
|
|
|
|
/**
|
|
*
|
|
*/
|
|
public function getSettings() : GameSettings
|
|
{
|
|
return $this->settings;
|
|
}
|
|
|
|
/**
|
|
*
|
|
*/
|
|
public function setSettings(GameSettings $settings)
|
|
{
|
|
$this->settings = $settings;
|
|
}
|
|
}
|