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.
Executables class (src/executables/executables.py) groups common spin actions that most games need. It sits in the middle of the class hierarchy between Conditions and your GameExecutables, so every method is available on self inside GameState.
Functions in Executables do not return values (unless documented otherwise). They mutate gamestate and emit events as side effects.
Class hierarchy context
GameExecutables or GameStateOverride.
Dependencies
Executables inherits from and relies on:
src.state.state_conditions.Conditions— state query helperssrc.calculations.board.Board—draw_board,force_special_board,get_syms_on_reel,count_special_symbolssrc.calculations.tumble.Tumble—tumble_board()src.events.events— all event emission functions
emit_linewin_events() lives on the Lines class (src/calculations/lines.py), and emit_wayswin_events() lives on the Ways class (src/calculations/ways.py). Call them as static methods: Lines.emit_linewin_events(self) and Ways.emit_wayswin_events(self). They are not defined on Executables.Board functions
draw_board()
reveal event.
Behavior depends on the active distribution’s force_freegame condition:
force_freegame = Truein basegame — randomly selects a scatter count fromscatter_triggersin the distribution conditions and callsforce_special_board()to guarantee exactly that many scatters on the board.force_freegame = Falsein basegame — generates boards until none have enough scatters to trigger free spins (prevents accidental freegame entry in non-freegame criteria).- In freegame — draws normally from reel strips with no scatter constraint.
When
True, calls reveal_event() after drawing. Pass False when you need to inspect the board before emitting.The special symbol attribute key used to count trigger symbols. Change this if your game uses a different key for the freespin trigger (e.g.
"bonus").force_special_board()
num_force_syms symbols of the given type. Retries internally until the exact count is achieved. Uses weighted random reel-stop selection.
Special symbol attribute key to force (e.g.
"scatter", "bonus").Exact number of that symbol type that must appear on the board.
get_syms_on_reel()
target_symbol (or any symbol with that special attribute) appears on the given reel strip. Returns a list with one entry per reel, each being a list of integer stop indices.
Win event functions
emit_tumble_win_events()
winInfo and updateTumbleWin events for the current tumble step, then calls evaluate_wincap(). Only emits if win_data["totalWin"] > 0.
Tumble functions
tumble_game_board()
tumbleBoard event containing the positions of removed symbols and the new symbols that replaced them.
Call after evaluating wins and emitting win events during a tumble sequence:
Win cap
evaluate_wincap()
win_manager.running_bet_win >= config.wincap. If so, sets self.wincap_triggered = True and emits a wincap event. Returns True if wincap was triggered, False otherwise.
Once triggered, win events stop being emitted and check_repeat() no longer retries on win criteria.
Special symbol helpers
count_special_symbols()
self.special_syms_on_board which is populated by the board drawing step.
Free spin functions
check_fs_condition()
True if the scatter count on the current board meets or exceeds the minimum trigger threshold defined in config.freespin_triggers[gametype], and self.repeat is False.
check_freespin_entry()
force_freegame = True). If not, sets self.repeat = True to retry the simulation. Use this when a free spin must only occur in designated criteria.
run_freespin_from_base()
self.record(), sets the total free spin count via update_freespin_amount(), then calls self.run_freespin().
This is the standard free spin entry point from the base game:
update_freespin_amount()
self.tot_fs to the number of free spins corresponding to the current scatter count, looked up from config.freespin_triggers[gametype]. Emits a freeSpinTrigger event (from basegame) or freeSpinRetrigger event (from freegame).
update_fs_retrigger_amt()
self.tot_fs when a retrigger scatter condition is met during the free game. Emits a freeSpinRetrigger event.
update_freespin()
updateFreeSpin event, increments self.fs, and resets win_manager.spin_win to zero.
end_freespin()
freeSpinEnd event containing the total amount won during the free game and the corresponding win level. Call this once the free spin loop completes.
Final win
evaluate_finalwin()
update_final_win() to compute and verify the payout multiplier, then emits a finalWin event. Always the last action inside the spin retry loop before check_repeat().
Global multiplier
update_global_mult()
self.global_multiplier by 1 and emits an updateGlobalMult event. Call this whenever the multiplier increases (e.g. on each winning tumble).
Overriding a function
Define the method with the same signature inGameExecutables or GameStateOverride. The MRO ensures your version is called:
game_executables.py
