card_id/common/game/score/score.go

72 lines
802 B
Go
Raw Normal View History

2022-04-14 00:20:00 +00:00
package score
type ComboTable interface {
Ratio(int) int
}
type MapTable struct {
m map[int]int
}
func (t *MapTable) Ratio(i int) int {
if v, ok := t.m[i]; ok {
return v
}
return 1
}
var DefaultTable ComboTable = &MapTable{
m: map[int]int{
0: 1,
1: 2,
2: 4,
3: 7,
4: 12,
5: 19,
6: 28,
7: 39,
8: 52,
9: 67,
10: 84,
11: 103,
12: 124,
13: 147,
14: 172,
15: 199,
16: 228,
17: 259,
18: 292,
19: 327,
20: 364,
21: 364,
22: 364,
23: 364,
24: 364,
25: 364,
26: 364,
27: 364,
28: 364,
29: 364,
30: 364,
31: 364,
32: 364,
33: 364,
34: 364,
35: 364,
36: 364,
37: 364,
38: 364,
39: 364,
40: 364,
41: 364,
42: 364,
43: 364,
44: 364,
45: 364,
46: 364,
47: 364,
48: 364,
49: 364,
50: 364,
}}