Figured out, that StringMap/ArrayList also can hold handles to another StringMap/ArrayList.
Guess, a such structure:
Scheme of emulation of 1st KeyValues key by my KeyValuesW methodmap:
Code:
ArrayList
|
|-[0]=StringMap -> | (unordered)
| | Key1 = Value1 (typeof String/Int/Float or another ArrayList handle => 2nd KeyValues key)
| | Key2 = Value2 ...
| | Key3 = Value3 ...
|(ordered)
|-[1]=Key1
|-[2]=Key2
|-[3]=Key3
ArrayList can only hold values.
We're using StringMap to be able hold key + value and fast access.
However, StringMap is unordered, so we're mirroring keys to ArrayList as values starting from index 1, where we can enumerate "keys" in correct order.
What do you think? Any additional optimizations possible?
__________________