C# HashSet
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: C# HashSet

  1. #1
    Join Date
    Nov 2013
    Posts
    1

    Question C# HashSet

    Helloo! I have some problems with hashset. I dont want use list because i dont want duplicated values.

    Code:
    for (int i = 0; i < Globals.Globals.PlayersList.Count; i++)
    {
        var ent = Globals.Globals.PlayersList[i];
        if (ent.name != null && !ent.PlayerConnected && !ent.PlayerDisconnected)
        {
            ent.PlayerConnected = true;
            //Adding player in game, not showing my code :3
        }
    }
    If i use foreach then i get errors because list changed...

  2. #2
    Join Date
    Oct 2013
    Posts
    16

    Re: C# HashSet

    More info? Anyway... list.Distinct()

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center