22 lines
472 B
Go
22 lines
472 B
Go
package chess
|
|
|
|
import (
|
|
"mchess_server/types"
|
|
)
|
|
|
|
type Knight struct {
|
|
Color types.ChessColor
|
|
}
|
|
|
|
func (k Knight) GetAllAttackedSquares(board Board, fromSquare types.Coordinate) []types.Coordinate {
|
|
return k.GetAllNonBlockedMoves(board, fromSquare)
|
|
}
|
|
|
|
func (k Knight) GetColor() types.ChessColor {
|
|
return k.Color
|
|
}
|
|
|
|
func (k Knight) GetAllNonBlockedMoves(board Board, fromSquare types.Coordinate) []types.Coordinate {
|
|
return board.GetNonBlockedKnightMoves(fromSquare)
|
|
}
|