mchess-server/types/move.go

14 lines
337 B
Go
Raw Normal View History

2023-06-25 14:11:29 +00:00
package types
type Move struct {
2023-06-25 22:51:20 +00:00
StartSquare Coordinate `json:"startSquare"`
EndSquare Coordinate `json:"endSquare"`
2023-07-03 17:32:39 +00:00
PromotionToPiece *string `json:"promotionToPiece,omitempty"`
2023-06-25 22:51:20 +00:00
ColorMoved ChessColor
2023-07-03 17:32:39 +00:00
PieceMoved PieceShortName
2023-06-25 14:11:29 +00:00
}
func (m Move) IsPromotionMove() bool {
2023-06-25 22:51:20 +00:00
return m.PromotionToPiece != nil
2023-06-25 14:11:29 +00:00
}