TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/StakeEngine/math-sdk/llms.txt
Use this file to discover all available pages before exploring further.
Lines class evaluates the active game board against a set of defined paylines. For each payline, it scans for consecutive matching symbols (including wilds) from reel 0 outward and computes payouts from config.paytable.
Configuration
Line wins require two config fields:Maps
(kind, symbol) tuples to payout multipliers.Maps a line index to an array of row positions — one per reel. Each entry defines which row on each reel forms the payline.
Lines.get_lines()
The active game board — a 2D list of
Symbol objects indexed as board[reel][row].Game configuration object. Must have
config.paytable and config.paylines populated.The symbol attribute name used to identify wild symbols. Defaults to
"wild".The symbol name used to look up wild-only payouts in
config.paytable. Defaults to "W".Multiplier strategy to apply. One of
"symbol", "global", or "combined". See Multiplier strategies.A scalar multiplier applied to every win when using the
"global" or "combined" strategies.Return value
Sum of all winning line payouts for this board state, after multipliers.
One entry per winning payline.
Wild substitution
On each payline, the evaluation tracks two potential wins simultaneously:- Wild-only win — using the
(kind, "W")paytable key, counting only the leading wild symbols. - Base win — using
(kind, symbol)for the first non-wild symbol found, counting wilds + matching symbols.
config.paytable. The higher payout wins. If the wild-only payout exceeds the substituted symbol payout, only the leading wild positions are included.
In lines games, a payline beginning with wilds is valid. The evaluation handles all-wild paylines as wild-only wins (looking up
(wild_matches, wild_sym) in the paytable). To prevent 3/4-kind wilds from outpaying longer non-wild combinations, only define wild payouts at the maximum kind (e.g. 5-kind only).Multiplier strategies
get_lines() delegates to apply_mult() from src/wins/multiplier_strategy.py.
| Strategy | Behavior |
|---|---|
"global" | Multiplies the base win by global_multiplier. Symbol attributes are ignored. |
"symbol" | Sums multiplier attribute values from all winning positions (minimum 1). Result applied to base win. global_multiplier is ignored. |
"combined" | Applies symbol multipliers first (additive sum), then multiplies by global_multiplier. |
Additional methods
Lines.emit_linewin_events(gamestate)
Emits win_info, set_win, and set_total events if win_manager.spin_win > 0. Also calls gamestate.evaluate_wincap().
Lines.record_lines_wins(gamestate)
Writes force-file entries for each line win, keyed by kind, symbol, mult, and gametype.
