- Introduced a new `spin_sessions` table to track user spin activities. - Updated the API to include a new endpoint for spinning games, allowing users to place bets and specify spin counts. - Enhanced game information structure and added validation for bets and spin counts. - Implemented the `Forest Fortune` slot game mechanics, including payline evaluation and scatter functionality. - Updated dependencies in `pyproject.toml` for development and added `httpx` for HTTP requests. - Added unit tests for the new slot mechanics and API endpoints to ensure functionality and reliability.
30 lines
916 B
Python
30 lines
916 B
Python
from __future__ import annotations
|
|
|
|
from decimal import Decimal
|
|
|
|
from app.slots.base import BaseSlot
|
|
from app.slots.rng import Rng
|
|
from app.slots.types import Grid, SessionMetaState, SpinOutcome
|
|
|
|
|
|
class ComingSoonSlot(BaseSlot):
|
|
status = "coming_soon"
|
|
min_bet = Decimal("1.00")
|
|
max_bet = Decimal("100.00")
|
|
min_spin_count = 1
|
|
max_spin_count = 1
|
|
|
|
def __init__(self, slug: str, title: str, description: str) -> None:
|
|
self.slug = slug
|
|
self.title = title
|
|
self.description = description
|
|
|
|
def build_grid(self, rng: Rng) -> Grid:
|
|
raise RuntimeError(f"Game '{self.slug}' is not available")
|
|
|
|
def evaluate(self, grid: Grid, bet: Decimal, multiplier: int) -> SpinOutcome:
|
|
raise RuntimeError(f"Game '{self.slug}' is not available")
|
|
|
|
def session_meta_on_spin(self, state: SessionMetaState, outcome: SpinOutcome) -> SessionMetaState:
|
|
return state
|