I'm trying to convert a Pascal type to C#. I have had a look around on Google, but I have not managed to find an answer, possibly because I am not googling correctly, so sorry if this is a duplicate.
I have these two Pascal types:
type
TVector3i = array [0..2] of longint;
Tcolface = packed record
A, B, C: word;
SurfaceA, SurfaceB: word;
end;
I know
Tcolface = packed record
A, B, C: word;
SurfaceA, SurfaceB: word;
end;
converts to:
struct Tcolface {
ushort A, B, C;
ushort SurfaceA, SurfaceB;
}
but how does TVector3i = array [0..2] of longint;
convert?
I'm trying to avoid using/writing a class, as when I convert the rest of the Pascal code it will be expecting the type as an array, and I am trying to avoid converting that to .x .y and .z.
I did consider doing float[] variablename = new float[3];
, but as soon as I get List<float[]> variblename
it gets a bit more complex.
The full code is:
TVector3i = array [0..2] of Longint;
TVector3f = array [0..2] of Single;
TVector3d = array [0..2] of Double;
TVector4i = array [0..3] of Longint;
TVector4f = array [0..3] of Single;
TVector4d = array [0..3] of Double;
TMatrix3i = array [0..2] of TVector3i;
TMatrix3f = array [0..2] of TVector3f;
TMatrix3d = array [0..2] of TVector3d;
TMatrix4i = array [0..3] of TVector4i;
TMatrix4f = array [0..3] of TVector4f;
TMatrix4d = array [0..3] of TVector4d;
Hence why I am trying to avoid classes :D