31 lines
937 B
Go
31 lines
937 B
Go
package assemble
|
|
|
|
import (
|
|
"encoding/json"
|
|
"mongo.games.com/game/gamesrv/slotspkg/internal/module/shared"
|
|
"strings"
|
|
)
|
|
|
|
type CustomFortune struct {
|
|
FreeSpinNum int64 `json:"fsn"` //剩余freespin
|
|
FreeNumMax int64 `json:"fnm"` //总次数
|
|
FreeNumTrigger int64 `json:"fnt"` //新增freespin
|
|
ForceRound int64 `json:"fr"` //第n次
|
|
}
|
|
|
|
func getDataByTheme(NodeTree *shared.LiteNodeTree) (map[int64]*shared.SpinLock, CustomFortune, int64) {
|
|
var Special = make(map[int64]*shared.SpinLock)
|
|
var customFortune CustomFortune
|
|
var FeatureTotalWin int64
|
|
for _, feature := range NodeTree.Features {
|
|
if strings.Contains(feature.Type, "Special") && len(feature.Custom) > 2 {
|
|
sp := shared.SpinLock{}
|
|
json.Unmarshal([]byte(feature.Custom), &sp)
|
|
Special[feature.NodeID] = &sp
|
|
json.Unmarshal([]byte(feature.Custom), &customFortune)
|
|
}
|
|
FeatureTotalWin += feature.Win
|
|
}
|
|
return Special, customFortune, FeatureTotalWin
|
|
}
|