app/Http/Livewire/Game.php: Implement jackpot.
This commit is contained in:
parent
5881efeb75
commit
7b513f5040
2 changed files with 17 additions and 3 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue