tome_lib/util.go

44 lines
588 B
Go
Raw Normal View History

2021-10-01 16:43:55 +00:00
package tome_lib
2021-11-16 21:44:19 +00:00
//go:generate enumer -type=GameStatus -json
2021-10-01 16:43:55 +00:00
type GameStatus int
const (
2021-11-16 21:44:19 +00:00
StatusLobby GameStatus = iota
2021-10-01 16:43:55 +00:00
StatusReady
StatusPlaying
StatusStop
StatusSentinalWin
StatusScourgeWin
StatusDraw
)
2021-11-16 21:44:19 +00:00
//go:generate enumer -type=TargetStatus -json
type TargetStatus int
2021-11-10 22:44:54 +00:00
const (
2021-11-16 21:44:19 +00:00
TargetSelf TargetStatus = iota
2021-11-10 22:44:54 +00:00
TargetOwn
TargetOwnEmpty
2021-11-10 22:44:54 +00:00
TargetOpp
TargetOppEmpty
2021-11-10 22:44:54 +00:00
TargetAny
TargetNone
)
2021-10-01 16:43:55 +00:00
const (
SentinalID = 1
ScourgeID = 2
)
2021-11-16 20:51:09 +00:00
func flipID(i int) int {
if i == SentinalID {
return ScourgeID
} else if i == ScourgeID {
return SentinalID
} else {
return -1
}
}