Initial Commit
This commit is contained in:
commit
ddf09fe00c
113 changed files with 187148 additions and 0 deletions
69
app/Game/GameSession.php
Normal file
69
app/Game/GameSession.php
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
<?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;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue