mchess-server/chess/knight.go

24 lines
551 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.GetAllNonBlockedMoves(board, fromSquare)
}
func (n Knight) GetColor() types.ChessColor {
return n.Color
}
func (n Knight) GetAllNonBlockedMoves(board Board, fromSquare types.Coordinate) []types.Coordinate {
return board.GetNonBlockedKnightMoves(fromSquare)
}
func (n Knight) AfterMoveAction(board *Board, fromSquare types.Coordinate) {}