@smartico/public-api 0.0.261 → 0.0.262
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/package.json
CHANGED
|
@@ -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,
|
|
5
|
+
public static canPlay = (t: SAWTemplate, user: {ach_points_balance: number, ach_gems_balance: number, ach_diamonds_balance: number}): boolean => {
|
|
6
6
|
if (t === null || t === undefined) {
|
|
7
7
|
return false;
|
|
8
8
|
}
|
|
@@ -17,6 +17,12 @@ class SAWUtils {
|
|
|
17
17
|
case SAWBuyInType.Points:
|
|
18
18
|
case SAWBuyInType.Gems:
|
|
19
19
|
case SAWBuyInType.Diamonds: {
|
|
20
|
+
let balance = user.ach_points_balance;
|
|
21
|
+
if (t.saw_buyin_type_id === SAWBuyInType.Gems) {
|
|
22
|
+
balance = user.ach_gems_balance;
|
|
23
|
+
} else if (t.saw_buyin_type_id === SAWBuyInType.Diamonds) {
|
|
24
|
+
balance = user.ach_diamonds_balance;
|
|
25
|
+
}
|
|
20
26
|
return t.buyin_cost_points <= balance;
|
|
21
27
|
}
|
|
22
28
|
|