duplicate values in HashSet

superchat6

New member
Joined
Nov 23, 2013
Messages
1
Programming Experience
3-5
Helloo! I have some problems with hashset. I dont want use list because i dont want duplicated values.

C#:
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
    }
}

Edit: If i use foreach then i get errors because list changed...
 
Last edited:
You've told us that you have a problem but you haven't told us what the problem is. You've told us that you get errors but you haven't told us what the errors are. Please provide a FULL and CLEAR explanation of the issue.
 
Back
Top Bottom