-
Notifications
You must be signed in to change notification settings - Fork 1
/
otherscenefeature.go
39 lines (33 loc) · 1.02 KB
/
otherscenefeature.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package lowcode
type OtherSceneFeatureConfig struct {
Type string `yaml:"type" json:"type"`
}
func (cfg *OtherSceneFeatureConfig) GetType() int {
if cfg.Type == "gameMulti" {
return OtherSceneFeatureGameMulti
} else if cfg.Type == "gameMultiSum" {
return OtherSceneFeatureGameMultiSum
} else if cfg.Type == "stepMulti" {
return OtherSceneFeatureStepMulti
} else if cfg.Type == "stepMultiSum" {
return OtherSceneFeatureStepMultiSum
}
return OtherSceneFeatureUnknow
}
const (
OtherSceneFeatureUnknow int = 0
OtherSceneFeatureGameMulti int = 1 // GameMulti,默认用乘法
OtherSceneFeatureGameMultiSum int = 2 // GameMulti,默认用加法
OtherSceneFeatureStepMulti int = 3 // StepMulti,默认用乘法
OtherSceneFeatureStepMultiSum int = 4 // StepMulti,默认用加法
)
type OtherSceneFeature struct {
Type int
Config *OtherSceneFeatureConfig
}
func NewOtherSceneFeature(cfg *OtherSceneFeatureConfig) *OtherSceneFeature {
return &OtherSceneFeature{
Type: cfg.GetType(),
Config: cfg,
}
}