PR pixi-reels

SymbolRegistry

pixi-reels


pixi-reels / index / SymbolRegistry

Class: SymbolRegistry

Defined in: symbols/SymbolRegistry.ts:15

Registry that maps symbolIds to their constructors and options.

Used by the builder and SymbolFactory to create symbols on demand.

Constructors

Constructor

new SymbolRegistry(): SymbolRegistry;

Returns

SymbolRegistry

Accessors

size

Get Signature

get size(): number;

Defined in: symbols/SymbolRegistry.ts:57

Returns

number


symbolIds

Get Signature

get symbolIds(): string[];

Defined in: symbols/SymbolRegistry.ts:53

Returns

string[]

Methods

create()

create(symbolId: string): ReelSymbol;

Defined in: symbols/SymbolRegistry.ts:37

Create a new symbol instance for the given symbolId.

Parameters

ParameterType
symbolIdstring

Returns

ReelSymbol


has()

has(symbolId: string): boolean;

Defined in: symbols/SymbolRegistry.ts:49

Parameters

ParameterType
symbolIdstring

Returns

boolean


register()

register<T>(
   symbolId: string, 
   SymbolClass: (options: any) => T, 
   options: T extends {
  constructor: (options: O) => any;
} ? O : any): void;

Defined in: symbols/SymbolRegistry.ts:25

Register a symbol type.

registry.register('cherry', SpriteSymbol, { textures: { cherry: tex } });

Type Parameters

Type Parameter
T extends ReelSymbol

Parameters

ParameterType
symbolIdstring
SymbolClass(options: any) => T
optionsT extends { constructor: (options: O) => any; } ? O : any

Returns

void