mchess-server/chess/knight.go

24 lines
555 B
Go
Raw Normal View History

package chess
2023-06-27 20:32:24 +00:00
import (
"mchess_server/types"
)
type Knight struct {
Color types.ChessColor
}
2023-07-05 19:15:01 +00:00
func (n Knight) GetAllAttackedSquares(board Board, fromSquare types.Coordinate) []types.Coordinate {
return n.GetAllNonBlockedSquares(board, fromSquare)
}
2023-07-05 19:15:01 +00:00
func (n Knight) GetColor() types.ChessColor {
return n.Color
}
func (n Knight) GetAllNonBlockedSquares(board Board, fromSquare types.Coordinate) []types.Coordinate {
2023-06-27 20:32:24 +00:00
return board.GetNonBlockedKnightMoves(fromSquare)
}
2023-07-05 19:15:01 +00:00
func (n Knight) AfterMoveAction(board *Board, fromSquare types.Coordinate) {}