UNPKG

pokie

Version:

A server-side video slot game logic framework for JavaScript and TypeScript.

10 lines (8 loc) 400 B
import {BetForNextSimulationRoundSetting, GameSessionHandling} from "pokie"; export class RandomChangeBetStrategy implements BetForNextSimulationRoundSetting { public setBetForNextRound(session: GameSessionHandling): void { const bets: number[] = session.getAvailableBets(); const bet: number = bets[Math.floor(Math.random() * bets.length)]; session.setBet(bet); } }