package types type Coordinate struct { Col int `json:"col"` Row int `json:"row"` } type Move struct { StartSquare Coordinate `json:"startSquare"` EndSquare Coordinate `json:"endSquare"` } type PieceClass string const ( Pawn PieceClass = "pawn" Rook PieceClass = "rook" Knight PieceClass = "knight" Bishop PieceClass = "bishop" Queen PieceClass = "queen" King PieceClass = "king" ) type ChessColor string const ( White ChessColor = "white" Black ChessColor = "black" ) func (c ChessColor) Opposite() ChessColor { if c == White { return Black } else { return White } } type Piece struct { Class PieceClass Color ChessColor HasMoved bool //we need this for pawns (first move is special) and rooks+king (for castling) }