is it possible to add two arguments somehow in a HashSet?
This Works
This is what i wantCode:public HashSet<PlayerFigures> PlayerFigures = new HashSet<PlayerFigures>();
Like dictionary but with HashSet insteadCode:public HashSet<ulong, PlayerFigures> PlayerFigures = new HashSet<ulong, PlayerFigures>();
Code:public Dictionary<ulong, PlayerFigures> PlayerFigures = new Dictionary<ulong, PlayerFigures>();
Multiple arguments in HashSet?
Discussion in 'Rust Development' started by Cuffee, Feb 14, 2017.
-
Technically, you could add a Tuple or KeyValuePair containing your ulong and PlayerFigures to the HashSet, but why can't you use Dictionary?
-
I have been told HashSet is faster
-
[DOUBLEPOST=1487084613][/DOUBLEPOST]If your ulong is going to store a userID (which is what I suspect from the context), and you need to lookup that userID to get the PlayerFigures, then Dictionary is your best option. Otherwise, you'll have to iterate over all of the entries in the HashSet and check each userID (which is slower than a Dictionary lookup). -
the data will be constantly changed, storing levels etc