1
0
Fork 0

app/Http/Livewire/Game.php: Implement jackpot.

This commit is contained in:
Henrik Hautakoski 2023-02-19 16:19:17 +01:00
parent 5881efeb75
commit 7b513f5040
2 changed files with 17 additions and 3 deletions

View file

@ -4,6 +4,11 @@ namespace App\Http\Livewire;
class Game extends GameComponent
{
/**
* If we hit the jackpot or not.
*/
public bool $jackpot = true;
/**
* Get the game session
*/
@ -39,9 +44,14 @@ class Game extends GameComponent
/**
* Triggered wen a card is pressed.
*/
public function toggle($pos)
public function toggle($pos, $jackpot)
{
$this->state->toggle($pos);
if ($jackpot) {
$this->state->setAll();
$this->jackpot = true;
} else {
$this->state->toggle($pos);
}
}
/**