This is what I have:
List<object[]> markers = new List<object[]>();
object[] marker = new object[2];
marker[0] = new Vector2(1, 2);
marker[1] = new Vector4(1, 2, 3, 4);
markers.Add(marker);
foreach (var item in markers)
{
int x = (Vector2)item[0].X; // Error: 'object' does not contain a definition
// for 'X' and no extension method 'X' accepting
// a first argument of type 'object' could be
// found (are you missing a using directive or
// an assembly reference?)
// other stuff
}
Is there a way to make this work without losing code readability, or should I try using a class instead of object array?
Vector4to aVector2(at least, I found no common ancestry between the two on MSDN).