Your Name 4 years ago
parent
commit
0cf0f71acb
1 changed files with 7 additions and 8 deletions
  1. 7
    8
      src/util/Basketball.js

+ 7
- 8
src/util/Basketball.js View File

1
 // 模拟比赛得分
1
 // 模拟比赛得分
2
 const matches = [
2
 const matches = [
3
-  [1, 0], [2, 0], [2, 1], [3, 0], [3, 1], [3, 2], [4, 0], [4, 1], [4, 2], [5, 0], [5, 1], [5, 2], [99, 0],
4
-  [0, 0], [1, 1], [2, 2], [3, 3], [99, 99],
5
-  [0, 1], [0, 2], [1, 2], [0, 3], [1, 3], [2, 3], [0, 4], [1, 4], [2, 4], [0, 5], [1, 5], [2, 5], [0, 99]
3
+  [50, 46], [60, 52], [75, 62], [88, 71], [95, 72], [107, 80],
4
+  [46, 50], [52, 60], [62, 75], [71, 88], [72, 95], [80, 107],
5
+  [40, 40], [60, 55], [96, 80], [120, 110], [150, 106],
6
 ]
6
 ]
7
 
7
 
8
 const playWayFunc = {
8
 const playWayFunc = {
13
 }
13
 }
14
 
14
 
15
 // 遍历模拟比赛获取最大, 最小奖金
15
 // 遍历模拟比赛获取最大, 最小奖金
16
-// rq 让球数
17
-// ys 预设总分
18
-export function GetPrice (allParts, rq, ys) {
16
+export function GetPrice (allParts) {
19
   let minPrice
17
   let minPrice
20
   let maxPrice
18
   let maxPrice
21
 
19
 
44
     const price = parts.map(part => {
42
     const price = parts.map(part => {
45
       // 场次组合 比如 2串1
43
       // 场次组合 比如 2串1
46
       return part.map(grp => {
44
       return part.map(grp => {
47
-        const { wayCode } = grp.detail
45
+        const { detail, spreadPoints, presetPoints } = grp
46
+        const { wayCode } = detail
48
         const fn = playWayFunc[wayCode]
47
         const fn = playWayFunc[wayCode]
49
-        return fn(grp, match, rq, ys)
48
+        return fn(grp, match, spreadPoints, presetPoints)
50
       }).filter(Boolean).reduce((acc, x) => acc * x, 1)
49
       }).filter(Boolean).reduce((acc, x) => acc * x, 1)
51
     }).reduce((acc, x) => acc + x, 0)
50
     }).reduce((acc, x) => acc + x, 0)
52
 
51