You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
834 B
Go
41 lines
834 B
Go
2 years ago
|
package config
|
||
|
|
||
|
// Zhgmang 指挥官-莽
|
||
|
type (
|
||
|
Zhgmang struct {
|
||
|
GiftEffect struct {
|
||
|
Free []int64 // 免费礼物
|
||
|
ClearScreen []int64 // 清屏礼物
|
||
|
RandomAddon []int64 // 随机加成礼物
|
||
|
}
|
||
|
}
|
||
|
ZhgmangGiftType int32
|
||
|
)
|
||
|
|
||
|
const (
|
||
|
ZhgmangGiftUnknown ZhgmangGiftType = iota
|
||
|
ZhgmangGiftFree
|
||
|
ZhgmangGiftClearScreen
|
||
|
ZhgmangGiftRandomAddon
|
||
|
)
|
||
|
|
||
|
func (z Zhgmang) ParseGiftType(id int64) ZhgmangGiftType {
|
||
|
if z.isContains(id, z.GiftEffect.Free) {
|
||
|
return ZhgmangGiftFree
|
||
|
} else if z.isContains(id, z.GiftEffect.ClearScreen) {
|
||
|
return ZhgmangGiftClearScreen
|
||
|
} else if z.isContains(id, z.GiftEffect.RandomAddon) {
|
||
|
return ZhgmangGiftRandomAddon
|
||
|
}
|
||
|
return ZhgmangGiftUnknown
|
||
|
}
|
||
|
|
||
|
func (z Zhgmang) isContains(id int64, arr []int64) bool {
|
||
|
for _, s := range arr {
|
||
|
if s == id {
|
||
|
return true
|
||
|
}
|
||
|
}
|
||
|
return false
|
||
|
}
|