I imagine there is an easy way to do this with LINQ expressions / queries, but how would one return a struct from an array of said structs, based on a specific value found inside of target struct?
For example, let's say we had:
enum MyEnum
{
a,
b,
c
}
struct MyStruct
{
MyEnum StructEnum;
int[] StructIntegers;
}
MyStruct[] ArrayOfStructs;
How would I find from MyStruct[] a specific element based on its StructEnum value? Or more specifically, get the StructIntegers arrays from this specific struct?
EDIT: What if ArrayOfStructs doesn't have any elements that have a specific enum that I am looking for? What is a smart way of checking this out first?
StructIntegerarrays combined into one?