@betorigami/games 3.3.0 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/dice/DiceContent/DiceContent.d.ts +2 -1
- package/dist/components/dice/DiceContentBottom/DiceContentBottom.d.ts +2 -1
- package/dist/components/dice/DiceGame.d.ts +4 -0
- package/dist/components/dice/dice-calculations.d.ts +11 -10
- package/dist/components/dice/dice.mock.api.d.ts +2 -1
- package/dist/index.mjs +3546 -3455
- package/package.json +3 -3
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { OrigamiElement, DiceDirection, SoundEffectsController, Language } from '@betorigami/game-ui-shared';
|
|
2
|
+
import { default as Big } from 'big.js';
|
|
2
3
|
import { DiceHistory } from '../DiceGame';
|
|
3
4
|
export declare class DiceContent extends OrigamiElement {
|
|
4
5
|
static styles: import('lit').CSSResult[];
|
|
@@ -10,7 +11,7 @@ export declare class DiceContent extends OrigamiElement {
|
|
|
10
11
|
resultValue: number | null;
|
|
11
12
|
history: DiceHistory[];
|
|
12
13
|
isDesktop: boolean;
|
|
13
|
-
diceMinMultiplier:
|
|
14
|
+
diceMinMultiplier: Big | null;
|
|
14
15
|
language: Language;
|
|
15
16
|
hotkeysOpenEnabled: boolean;
|
|
16
17
|
soundEffects?: SoundEffectsController;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { OrigamiElement, DiceDirection, Language } from '@betorigami/game-ui-shared';
|
|
2
|
+
import { default as Big } from 'big.js';
|
|
2
3
|
export declare class DiceContentBottom extends OrigamiElement {
|
|
3
4
|
static styles: import('lit').CSSResult[];
|
|
4
5
|
selectedValue: number;
|
|
@@ -6,7 +7,7 @@ export declare class DiceContentBottom extends OrigamiElement {
|
|
|
6
7
|
disabled: boolean;
|
|
7
8
|
language: Language;
|
|
8
9
|
edge: 3 | 4 | 2 | 8 | 1;
|
|
9
|
-
diceMinMultiplier:
|
|
10
|
+
diceMinMultiplier: Big | null;
|
|
10
11
|
hotkeysOpenEnabled: boolean;
|
|
11
12
|
private _winChanceInputValue;
|
|
12
13
|
private _multiplierInputValue;
|
|
@@ -5,6 +5,7 @@ export interface DiceHistory {
|
|
|
5
5
|
id: string;
|
|
6
6
|
}
|
|
7
7
|
export declare class DiceGame extends GameComponent {
|
|
8
|
+
private static readonly dice;
|
|
8
9
|
static styles: import('lit').CSSResult[];
|
|
9
10
|
private diceDirection;
|
|
10
11
|
private selectedValue;
|
|
@@ -17,12 +18,15 @@ export declare class DiceGame extends GameComponent {
|
|
|
17
18
|
private _rollValueInputValid;
|
|
18
19
|
private _diceManualEl?;
|
|
19
20
|
private _diceAutoEl?;
|
|
21
|
+
private get diceMinMultiplier();
|
|
20
22
|
get isToggleDisabled(): boolean;
|
|
21
23
|
get areInputsDisabled(): boolean;
|
|
22
24
|
private isSpacebarDisabled;
|
|
23
25
|
private handleSpacebar;
|
|
24
26
|
diceRollOverToggle: () => void;
|
|
25
27
|
constructor();
|
|
28
|
+
protected willUpdate(): void;
|
|
29
|
+
protected adjustBetAmount(autobetSettings: AutobetSettingsWithId, gameOutcome: 'Win' | 'Loss' | 'Draw', originalBetAmount: string, currentBetAmount: string): string;
|
|
26
30
|
private decreaseSlider;
|
|
27
31
|
private increaseSlider;
|
|
28
32
|
private addToHistory;
|
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
import { DiceDirection } from '@betorigami/game-ui-shared';
|
|
2
2
|
import { default as Big } from 'big.js';
|
|
3
3
|
export declare class DiceCalculations {
|
|
4
|
+
private static readonly dice;
|
|
4
5
|
static totalDiceValue: number;
|
|
5
6
|
static minWinChance: number;
|
|
6
7
|
static inputValuePrecision: number;
|
|
7
|
-
static getMaxWinChance(edge: number, minMultiplier:
|
|
8
|
+
static getMaxWinChance(edge: number, minMultiplier: Big | null): number;
|
|
8
9
|
static getMultiplier(edge: number, selectedValue: number, diceDirection: DiceDirection): string;
|
|
9
10
|
static getWinChance(selectedValue: number, diceDirection: DiceDirection): string;
|
|
10
11
|
static getSelectedValueFromMultiplier(edge: number, multiplier: Big.BigSource, diceDirection: DiceDirection): number;
|
|
11
12
|
static getSelectedValueFromWinChance(winChancePercentage: Big.BigSource, diceDirection: DiceDirection): number;
|
|
12
13
|
private static isSelectableBelow;
|
|
13
14
|
private static getBelowSelectableBounds;
|
|
14
|
-
static getMinSelectableValue(edge: number, diceDirection: DiceDirection, minMultiplier:
|
|
15
|
-
static getMaxSelectableValue(edge: number, diceDirection: DiceDirection, minMultiplier:
|
|
16
|
-
static clampSelectedValue(selectedValue: number, edge: number, diceDirection: DiceDirection, minMultiplier:
|
|
15
|
+
static getMinSelectableValue(edge: number, diceDirection: DiceDirection, minMultiplier: Big | null): number;
|
|
16
|
+
static getMaxSelectableValue(edge: number, diceDirection: DiceDirection, minMultiplier: Big | null): number;
|
|
17
|
+
static clampSelectedValue(selectedValue: number, edge: number, diceDirection: DiceDirection, minMultiplier: Big | null): number;
|
|
17
18
|
static getSelectedValueFromRollOver(selectedValue: number): number;
|
|
18
|
-
static getSliderMin(edge: number, diceDirection: DiceDirection, minMultiplier:
|
|
19
|
-
static getSliderMax(edge: number, diceDirection: DiceDirection, minMultiplier:
|
|
20
|
-
static getRollRange(edge: number, diceDirection: DiceDirection, minMultiplier:
|
|
19
|
+
static getSliderMin(edge: number, diceDirection: DiceDirection, minMultiplier: Big | null): number;
|
|
20
|
+
static getSliderMax(edge: number, diceDirection: DiceDirection, minMultiplier: Big | null): number;
|
|
21
|
+
static getRollRange(edge: number, diceDirection: DiceDirection, minMultiplier: Big | null): {
|
|
21
22
|
min: number;
|
|
22
23
|
max: number;
|
|
23
24
|
};
|
|
24
|
-
static getMinMultiplier(edge: number, minMultiplier:
|
|
25
|
+
static getMinMultiplier(edge: number, minMultiplier: Big | null): string;
|
|
25
26
|
static getMaxMultiplier(edge: number): string;
|
|
26
|
-
static isValidMultiplier(edge: number, multiplier: string, minMultiplier:
|
|
27
|
-
static isValidWinChance(winChance: string, edge: number, minMultiplier:
|
|
27
|
+
static isValidMultiplier(edge: number, multiplier: string, minMultiplier: Big | null): boolean;
|
|
28
|
+
static isValidWinChance(winChance: string, edge: number, minMultiplier: Big | null): boolean;
|
|
28
29
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { default as Big } from 'big.js';
|
|
1
2
|
import { DiceBetResult, DiceStartArgs, IDiceApi } from './dice.api';
|
|
2
3
|
export declare class MockDiceApi implements IDiceApi {
|
|
3
4
|
private readonly getEdge;
|
|
4
5
|
private readonly getBalance;
|
|
5
6
|
private readonly getMinMultiplier;
|
|
6
|
-
constructor(getEdge: () => number, getBalance: () => number, getMinMultiplier: () =>
|
|
7
|
+
constructor(getEdge: () => number, getBalance: () => number, getMinMultiplier: () => Big | null);
|
|
7
8
|
private isValidSelectedValue;
|
|
8
9
|
startBet(data: DiceStartArgs): Promise<DiceBetResult>;
|
|
9
10
|
private static getRandomValueInRange;
|