Archived
1
0
Fork 0
This repository has been archived on 2026-06-16. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
wow-raid-bingo/app/Http/Livewire/Game.php
2021-10-18 11:56:52 +02:00

62 lines
986 B
PHP

<?php
namespace App\Http\Livewire;
class Game extends GameComponent
{
/**
* Get the game session
*/
public function getSessionProperty()
{
return $this->service->session();
}
/**
* Get the game board.
*/
public function getBoardProperty()
{
return $this->session->getBoard();
}
/**
* Get the game state.
*/
public function getStateProperty()
{
return $this->session->getBoardState();
}
/**
* Clear everything.
*/
public function clear()
{
$this->board->clear();
}
/**
* Triggered wen a card is pressed.
*/
public function toggle($pos)
{
$this->state->toggle($pos);
}
/**
* Reset game session.
*/
public function restart()
{
$this->service->newSession();
}
/**
* Render the game board.
*/
public function render()
{
return view('game');
}
}