I need some pointers in what people think would be better, performance-wise. (It’s not optimal to use strings as keys, I know)

C#

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

publicclassTrictionary<T>

{

Dictionary<string,T>values;

publicTrictionary()

{

values=newDictionary<string,T>();

}

publicbytethis[intx,inty,intz]

{

get

{

if(values.ContainsKey(x+"|"+y+"|"+z))

returnvalues[x+"|"+y+"|"+z];

returndefault(T);

}

}

}

Edit: This is the code I’m using right now. (Takes 2 seconds to fill those 33 million bytes) Although, then I’m limited to setting the max-values, and int.MaxValue in all dimensions doesn’t work (d’uh)