shufflecom-calculations 4.1.1 → 4.1.3
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/lib/games/coinflip/coinflip-rules.d.ts +1 -1
- package/lib/games/coinflip/coinflip-rules.js +1 -1
- package/lib/games/coinflip/coinflip-rules.js.map +1 -1
- package/lib/games/floor-is-lava-rules.d.ts +52 -0
- package/lib/games/floor-is-lava-rules.js +82 -0
- package/lib/games/floor-is-lava-rules.js.map +1 -0
- package/lib/games/floor-is-lava.d.ts +56 -0
- package/lib/games/floor-is-lava.js +134 -0
- package/lib/games/floor-is-lava.js.map +1 -0
- package/lib/games/true-random-rng.d.ts +13 -0
- package/lib/games/true-random-rng.js +19 -0
- package/lib/games/true-random-rng.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/lib/sports/sports.types.d.ts +5 -7
- package/lib/sports/sports.types.js +4 -5
- package/lib/sports/sports.types.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/games/coinflip/coinflip-rules.spec.ts +8 -10
- package/src/games/coinflip/coinflip-rules.ts +1 -1
- package/src/games/floor-is-lava-rules.spec.ts +126 -0
- package/src/games/floor-is-lava-rules.ts +125 -0
- package/src/games/floor-is-lava.spec.ts +502 -0
- package/src/games/floor-is-lava.ts +184 -0
- package/src/games/true-random-rng.ts +17 -0
- package/src/index.ts +2 -0
- package/src/sports/sports.types.ts +6 -9
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { RandomNumberGenerator } from './random-number-generator.interface';
|
|
2
|
+
|
|
3
|
+
export class TrueRandomRng implements RandomNumberGenerator {
|
|
4
|
+
getRandomIntsWithReplacement({ min, max, count }: { min: number; max: number; count: number }): number[] {
|
|
5
|
+
return Array.from({ length: count }, () => min + Math.floor(Math.random() * (max - min + 1)));
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
getRandomIntsWithoutReplacement({ min, max, count }: { min: number; max: number; count: number }): number[] {
|
|
9
|
+
const pool = Array.from({ length: max - min + 1 }, (_, i) => min + i);
|
|
10
|
+
const result: number[] = [];
|
|
11
|
+
for (let i = 0; i < count; i++) {
|
|
12
|
+
const index = Math.floor(Math.random() * pool.length);
|
|
13
|
+
result.push(pool.splice(index, 1)[0]);
|
|
14
|
+
}
|
|
15
|
+
return result;
|
|
16
|
+
}
|
|
17
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -51,3 +51,5 @@ export * from './games/coinflip/coinflip-rules';
|
|
|
51
51
|
export * from './games/coinflip/coinflip-classic';
|
|
52
52
|
export * from './games/coinflip/coinflip-classic-progressive';
|
|
53
53
|
export * from './games/coinflip/coinflip-target';
|
|
54
|
+
export * from './games/floor-is-lava';
|
|
55
|
+
export * from './games/floor-is-lava-rules';
|
|
@@ -638,21 +638,12 @@ export class MarketLayout {
|
|
|
638
638
|
marketDisplayType: SportsMarketDisplayType;
|
|
639
639
|
}
|
|
640
640
|
|
|
641
|
-
export enum MarketInfoVariantKey {
|
|
642
|
-
MAP = 'MAP',
|
|
643
|
-
}
|
|
644
|
-
|
|
645
|
-
export type MapVariant = string;
|
|
646
|
-
|
|
647
641
|
export class BaseDisplayGroup {
|
|
648
642
|
groupKey: string;
|
|
649
643
|
groupName: string;
|
|
650
644
|
groupSortName: string;
|
|
651
645
|
selectionGroups: SelectionGroup[] | null;
|
|
652
646
|
layout: MarketLayout;
|
|
653
|
-
variantData: Nullable<{
|
|
654
|
-
[MarketInfoVariantKey.MAP]?: MapVariant; // used for map market of oddin
|
|
655
|
-
}>;
|
|
656
647
|
is2UpAvailable: boolean;
|
|
657
648
|
}
|
|
658
649
|
|
|
@@ -720,10 +711,16 @@ export class SportsNewMarketOddsUpdate extends SportsMarketOddsBase {
|
|
|
720
711
|
expiryTime: Nullable<Date>;
|
|
721
712
|
}
|
|
722
713
|
|
|
714
|
+
export class SgmSubGroup {
|
|
715
|
+
group: SportsMarketGroup;
|
|
716
|
+
weight: number;
|
|
717
|
+
}
|
|
718
|
+
|
|
723
719
|
export class SportsMarketInfo {
|
|
724
720
|
odds: SportsNewMarketOddsUpdate[];
|
|
725
721
|
display: DisplayGroup[];
|
|
726
722
|
updatedAt: Nullable<Date>;
|
|
723
|
+
sgmSubGroups: Nullable<SgmSubGroup[]>;
|
|
727
724
|
}
|
|
728
725
|
|
|
729
726
|
export class SportsMarketSubInfo extends SportsMarketInfo {
|