I am making a game in Unity with c# code and I want a character to have something like aggro table.
It will be something like (float, int) table where int is other character id and float is actual aggro value.
Basically, I have few things in mind:
- The table should be sorted by float keys so I can quickly get top entries
- I need to be able to frequently lookup entries by its int value because of (3)
- I want to change float key frequently and have the table sorted up all the time
- I dont care about memory usage as there wont be that many entries
- I do care about performance of operations like inserting/removing/changing entries and re-sorting the list
I am not very experienced in C# saw few things like sortedlist/dictionary, but it doesnt seem to be optimalized for all the things I want.
Do you have any advice?
EDIT: Not sure if I did a good job at explaining what I want to achieve. It might be very similar to a table of football player names and number of goals they scored during the season. I will frequently ask for "most productive players" and also I will frequently update their scores by looking up their names and changing their stats, needing the table to be sorted all the time.