19 lines
625 B
Go
19 lines
625 B
Go
package chess
|
|
|
|
type Violation string
|
|
|
|
var (
|
|
InvalidMove Violation = "invalid move"
|
|
NoPieceAtStartSquare Violation = "no piece at start square"
|
|
WrongColorMoved Violation = "wrong color moved"
|
|
TargetSquareIsOccupied Violation = "target square is occupied"
|
|
KingInCheck Violation = "king would be in check after move"
|
|
SomethingWentWrong Violation = "something went wrong"
|
|
CastlingThroughCheck Violation = "king would move through check"
|
|
CastlingWhileKingInCheck Violation = "king cannot castle while in check"
|
|
)
|
|
|
|
func (v Violation) String() string {
|
|
return string(v)
|
|
}
|