mchess-server/types/common.go
Marco af993876fd Introduce check if the game has ended (checkmate/stalemate)
Introduce checkmate check and send out 'gameEnded' message
2024-01-17 23:06:48 +01:00

27 lines
414 B
Go

package types
type ChessColor string
const (
NoColor ChessColor = "no_color"
White ChessColor = "white"
Black ChessColor = "black"
)
func (c ChessColor) Opposite() ChessColor {
if c == White {
return Black
} else {
return White
}
}
type AdditionalState struct {
BlackKingMoved bool
WhiteKingMoved bool
BlackHRookMoved bool
BlackARookMoved bool
WhiteHRookMoved bool
WhiteARookMoved bool
}