fCraft.PlayerEnumerable.Union C# (CSharp) Method

Union() private method

private Union ( [ source, [ includedPlayer ) : IEnumerable
source [
includedPlayer [
return IEnumerable
        public static IEnumerable<Player> Union( [NotNull] this IEnumerable<Player> source, [NotNull] Player includedPlayer ) {
            bool found = false;
            foreach( Player player in source ) {
                yield return player;
                if( player == includedPlayer ) {
                    found = true;
                }
            }
            if( !found ) {
                yield return includedPlayer;
            }
        }