Wheel
A WOJ wheel for a specific board and maximum spins. The number of slots on the wheel will be the number of categories + the number of special sectors (6). Slots are fixed on the wheel. Each special and category is a sector. Each sector can be randomly assigned to a slot on the wheel. Categories are always populated in the sector list first, followed by special sectors, i.e. category 0 on the board is always sector 0 on the wheel.
Constructor Summary
Public Constructor | ||
public |
constructor(board: Board, maxSpins: number) |
Member Summary
Public Members | ||
public get |
|
|
public get |
|
|
public |
|
|
public |
|
|
public |
|
Method Summary
Public Methods | ||
public |
Assigns sectors numbers to each slot ordered by categories then special. |
|
public |
Return a random slot number from the wheel. |
|
public |
getSectorName(sectorNumber: number): number Get sector name for the specific sector number. |
|
public |
getSectorNumber(slot: number): number Get sector number at a specific slot number. |
|
public |
Randomizes sectors in the slots. |
|
public |
reset() Resets used spins to 0. |
|
public |
sectorIsCategory(sectorNumber: number): boolean Check if the sector is a category (vs a special sector). |
|
public |
Spins the wheel and returns a random sector. |
Public Constructors
Public Members
Public Methods
public assignSectors() source
Assigns sectors numbers to each slot ordered by categories then special.
public getSectorName(sectorNumber: number): number source
Get sector name for the specific sector number.
Params:
Name | Type | Attribute | Description |
sectorNumber | number | sector number. |
public getSectorNumber(slot: number): number source
Get sector number at a specific slot number.
Params:
Name | Type | Attribute | Description |
slot | number | slot number in the wheel. |