self.board holds a Symbol instance. Symbols are lightweight objects created from a shared SymbolDefinition (via SymbolStorage), so definition data is not duplicated across the board.
Class hierarchy
Symbol
Properties
str
Shorthand symbol name (e.g.
"H1", "W", "S"). Read from the SymbolDefinition.bool
True if the symbol name appears in any config.special_symbols group.set[str]
Set of all special attribute names assigned to this symbol (e.g.
{"wild"}, {"scatter", "multiplier"}).bool
Set to
True by win evaluation functions (cluster, scatter) to mark this position for removal during a tumble.int | None
Multiplier value.
None unless the symbol has the "multiplier" special flag or assign_attribute() is called.Methods
symbol.check_attribute(*attrs)
True if any of the given attribute names exist on the symbol with a value that is not None or False.
symbol.get_attribute(attr)
getattr. The attribute must exist on the symbol instance.
symbol.assign_attribute(attribute_dict)
SymbolDefinition
The shared definition object for a symbol name. Created once per unique name at SymbolStorage init time.
str
Symbol name string.
set[str]
All special attribute keys this symbol belongs to, derived from
config.special_symbols.bool
True if special_flags is non-empty.bool
True if the symbol name appears as a value in config.paytable.list | None
List of
{str(kind): payout} dicts for this symbol. None if not paying.SymbolStorage
GameState initialization. Holds one SymbolDefinition per unique symbol name. Provides the create_symbol() factory method used by Board.
Symbol from the stored SymbolDefinition. Raises ValueError if name is not registered:
Special symbols configuration
config.special_symbols maps attribute names to lists of symbol names:
Symbol is initialized, all matching flags are set via assign_default_attribute():
Special symbol functions
To assign dynamic attribute values at symbol creation time, overrideassign_special_sym_function() in the GameStateOverride class:
special_symbol_functions[name] is called with the new Symbol instance immediately after creation in Board.create_symbol().
Symbol
__slots__ is a fixed list. You cannot add attributes not defined in __slots__ at runtime. If your game requires a new attribute (e.g. prize), it must already be declared in the Symbol class.