mchess-server/types/move.go

14 lines
337 B
Go

package types
type Move struct {
StartSquare Coordinate `json:"startSquare"`
EndSquare Coordinate `json:"endSquare"`
PromotionToPiece *string `json:"promotionToPiece,omitempty"`
ColorMoved ChessColor
PieceMoved PieceShortName
}
func (m Move) IsPromotionMove() bool {
return m.PromotionToPiece != nil
}