public static IEnumerable<Player> Spectating( [NotNull] this IEnumerable<Player> source, [NotNull] Player player ) {
if( source == null ) throw new ArgumentNullException( "source" );
if( player == null ) throw new ArgumentNullException( "player" );
foreach( Player otherPlayer in source ) {
if( otherPlayer.SpectatedPlayer == player ) {
yield return otherPlayer;
}
}
}