初步完成龙台的读卡逻辑
This commit is contained in:
33
internal/routes/play/card_pusher/line_group.go
Normal file
33
internal/routes/play/card_pusher/line_group.go
Normal file
@@ -0,0 +1,33 @@
|
||||
package card_pusher
|
||||
|
||||
type LineGroup struct {
|
||||
Name string
|
||||
OutOK int
|
||||
Lower int
|
||||
Error int
|
||||
Empty int
|
||||
|
||||
Push int
|
||||
Reset int
|
||||
Pull int
|
||||
}
|
||||
|
||||
func (g *LineGroup) AllInLines() []int {
|
||||
return []int{g.OutOK, g.Lower, g.Error, g.Empty}
|
||||
}
|
||||
|
||||
func (g *LineGroup) AllLabel() map[int]string {
|
||||
labels := make(map[int]string)
|
||||
labels[g.OutOK] = "OutOk"
|
||||
labels[g.Lower] = "Lower"
|
||||
labels[g.Error] = "Error"
|
||||
labels[g.Empty] = "Empty"
|
||||
labels[g.Push] = "Push"
|
||||
labels[g.Reset] = "Reset"
|
||||
labels[g.Pull] = "Pull"
|
||||
return labels
|
||||
}
|
||||
|
||||
func (g *LineGroup) Ok() bool {
|
||||
return g.OutOK > 1 && g.Lower > 1 && g.Error > 1 && g.Empty > 1 && g.Push > 1 && g.Reset > 1 && g.Pull > 1
|
||||
}
|
||||
Reference in New Issue
Block a user