@smartico/public-api 0.0.260 → 0.0.261

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.
@@ -56,6 +56,12 @@ ___
56
56
 
57
57
  ___
58
58
 
59
+ ### GEMS\_AND\_DIAMONDS
60
+
61
+ • **GEMS\_AND\_DIAMONDS** = ``"gems-and-diamonds"``
62
+
63
+ ___
64
+
59
65
  ### UNKNOWN
60
66
 
61
67
  • **UNKNOWN** = ``"unknown"``
@@ -23,3 +23,15 @@ ___
23
23
  ### Unknown
24
24
 
25
25
  • **Unknown** = ``"unknown"``
26
+
27
+ ___
28
+
29
+ ### Gems
30
+
31
+ • **Gems** = ``"gems"``
32
+
33
+ ___
34
+
35
+ ### Diamonds
36
+
37
+ • **Diamonds** = ``"diamonds"``
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartico/public-api",
3
- "version": "0.0.260",
3
+ "version": "0.0.261",
4
4
  "description": "Smartico public API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -3,6 +3,8 @@ export enum SAWBuyInType {
3
3
  Free = 1,
4
4
  Points = 2,
5
5
  Spins = 3,
6
+ Gems = 4,
7
+ Diamonds = 5,
6
8
  }
7
9
 
8
10
  export enum SAWBuyInTypeName {
@@ -10,6 +12,8 @@ export enum SAWBuyInTypeName {
10
12
  Points = 'points',
11
13
  Spins = 'spins',
12
14
  Unknown = 'unknown',
15
+ Gems = 'gems',
16
+ Diamonds = 'diamonds',
13
17
  }
14
18
 
15
19
  /** @hidden */
@@ -19,6 +23,8 @@ export const SAWBuyInTypeNamed = (type: SAWBuyInType): SAWBuyInTypeName => {
19
23
  [SAWBuyInType.Free]: SAWBuyInTypeName.Free,
20
24
  [SAWBuyInType.Points]: SAWBuyInTypeName.Points,
21
25
  [SAWBuyInType.Spins]: SAWBuyInTypeName.Spins,
26
+ [SAWBuyInType.Gems]: SAWBuyInTypeName.Gems,
27
+ [SAWBuyInType.Diamonds]: SAWBuyInTypeName.Diamonds,
22
28
  }[type] || SAWBuyInTypeName.Unknown
23
29
  );
24
30
  };
@@ -9,6 +9,7 @@ export enum SAWPrizeType {
9
9
  CHANGE_LEVEL = 7,
10
10
  MISSION = 8,
11
11
  RAFFLE_TICKET = 9,
12
+ GEMS_AND_DIAMONDS = 10,
12
13
  }
13
14
 
14
15
  export enum MiniGamePrizeTypeName {
@@ -21,6 +22,7 @@ export enum MiniGamePrizeTypeName {
21
22
  CHANGE_LEVEL = 'change-level',
22
23
  MISSION = 'mission',
23
24
  RAFFLE_TICKET = 'raffle-ticket',
25
+ GEMS_AND_DIAMONDS = 'gems-and-diamonds',
24
26
  UNKNOWN = 'unknown',
25
27
  }
26
28
 
@@ -37,6 +39,7 @@ export const MiniGamePrizeTypeNamed = (type: SAWPrizeType): MiniGamePrizeTypeNam
37
39
  [SAWPrizeType.CHANGE_LEVEL]: MiniGamePrizeTypeName.CHANGE_LEVEL,
38
40
  [SAWPrizeType.MISSION]: MiniGamePrizeTypeName.MISSION,
39
41
  [SAWPrizeType.RAFFLE_TICKET]: MiniGamePrizeTypeName.RAFFLE_TICKET,
42
+ [SAWPrizeType.GEMS_AND_DIAMONDS]: MiniGamePrizeTypeName.GEMS_AND_DIAMONDS,
40
43
  }[type] || MiniGamePrizeTypeName.UNKNOWN
41
44
  );
42
45
  };
@@ -2,7 +2,7 @@ import { SAWBuyInType } from './SAWBuyInType';
2
2
  import { SAWTemplate } from './SAWTemplate';
3
3
 
4
4
  class SAWUtils {
5
- public static canPlay = (t: SAWTemplate, pointsBalance: number): boolean => {
5
+ public static canPlay = (t: SAWTemplate, balance: number): boolean => {
6
6
  if (t === null || t === undefined) {
7
7
  return false;
8
8
  }
@@ -14,9 +14,12 @@ class SAWUtils {
14
14
  case SAWBuyInType.Spins: {
15
15
  return t.spin_count !== null && t.spin_count > 0;
16
16
  }
17
- case SAWBuyInType.Points: {
18
- return t.buyin_cost_points <= pointsBalance;
17
+ case SAWBuyInType.Points:
18
+ case SAWBuyInType.Gems:
19
+ case SAWBuyInType.Diamonds: {
20
+ return t.buyin_cost_points <= balance;
19
21
  }
22
+
20
23
  default: {
21
24
  console.error('MiniGamesUtils.canPlay: Unknwon SAW buyin type ' + t.saw_buyin_type_id);
22
25
  return false;
@@ -299,11 +299,15 @@ declare enum SAWBuyInType {
299
299
  Free = 1,
300
300
  Points = 2,
301
301
  Spins = 3,
302
+ Gems = 4,
303
+ Diamonds = 5,
302
304
  }
303
305
  declare enum SAWBuyInTypeName {
304
306
  Free = 'free',
305
307
  Points = 'points',
306
308
  Spins = 'spins',
309
+ Gems = 'gems',
310
+ Diamonds = 'diamonds',
307
311
  Unknown = 'unknown',
308
312
  }
309
313
  declare enum SAWGameType {