// Used more specifically to enforce board logic public bool DoesMoveLeaveUsInCheck(IBoardState <ChessPieceEntity> boardState, BoardMove move) { var attackingPlayer = boardState.GetItem(move.From).Item.Player; var clone = (IBoardState <ChessPieceEntity>)boardState.Clone(); _moveService.Move(clone, move); var king = clone.GetItems((int)attackingPlayer, (int)ChessPieceName.King).Single(); return(_playerStateService.IsLocationUnderCheck(clone, king.Location, king.Item.Player).result); }