Scenario is simple.
I have static list of items, created in editor.
Items are searched by their name (FName).
At runtime this list never changes, order is not important (so it can be sorted, prior using).
What I need is to do with this list is have quick random access to it's elements, by using ItemName (FName).
List can have potentially hunderds of entires, and will be queried often by various game systems (UI, item looting, item equiping, etc).
I started implementing it using TMap, but I wonder if I'm not over thinking the problem, and TArray can be used just as well, with some custom code for searching ?
I have static list of items, created in editor.
Items are searched by their name (FName).
At runtime this list never changes, order is not important (so it can be sorted, prior using).
What I need is to do with this list is have quick random access to it's elements, by using ItemName (FName).
List can have potentially hunderds of entires, and will be queried often by various game systems (UI, item looting, item equiping, etc).
I started implementing it using TMap, but I wonder if I'm not over thinking the problem, and TArray can be used just as well, with some custom code for searching ?
Comment