24 lines
555 B
Go
24 lines
555 B
Go
package chess
|
|
|
|
import (
|
|
"mchess_server/types"
|
|
)
|
|
|
|
type Knight struct {
|
|
Color types.ChessColor
|
|
}
|
|
|
|
func (n Knight) GetAllAttackedSquares(board Board, fromSquare types.Coordinate) []types.Coordinate {
|
|
return n.GetAllNonBlockedSquares(board, fromSquare)
|
|
}
|
|
|
|
func (n Knight) GetColor() types.ChessColor {
|
|
return n.Color
|
|
}
|
|
|
|
func (n Knight) GetAllNonBlockedSquares(board Board, fromSquare types.Coordinate) []types.Coordinate {
|
|
return board.GetNonBlockedKnightMoves(fromSquare)
|
|
}
|
|
|
|
func (n Knight) AfterMoveAction(board *Board, fromSquare types.Coordinate) {}
|