These are fixed data structures that I have to work with, I cannot redefine or change them sadly.
I'm looping over a list with each of the objects in the list looking as follows (hover over in Visual Studio).
{[ida: 828, idb: 133, XXX.XXX.XXX.MyObject]}
Key: {ida: 828, idb: 133}
Value: {XXX.XXX.XXX.MyObject}
How would I look up value in this list by key, i.e. say how to a lookup a value given one of the keys such as ida=828. I can get the key-values out as I go through the list, but is there anyway to do this faster? I.e. given 828 I can obtain Value, rather like ida=828
or object.key.ida[828]
One of the issues is these datatypes are not changeable. Any suggestions. Is there only way to get at say ida to loop around all the objects?
I know I can use .Equals to determine whether a key value exists, i.e. object.key.ida.Equals(828),
but this still leaves the question of getting at the Value. Is this possible?
The data structure looks like the following:
Collection<string, Key, Tstuff>
public struct Key
{
public long ida;
public long idb;
}
Tstuff
is a generic type, but in this case is being passed in the following (effectively the value as above):
public struct D2
{
public float A;
public float B;
}