mchess-server/types/common.go

19 lines
214 B
Go

package types
type ChessColor string
const (
White ChessColor = "white"
Black ChessColor = "black"
)
func (c ChessColor) Opposite() ChessColor {
if c == White {
return Black
} else {
return White
}
}