Since I've started to move in-process with my C#, the classes seem to be annoying to type out. This question goes out mostly to Apoc and jjaa, but is there anyway to avoid typing all the crap, like the type of every value in the class so you can use a pointer? For example:
Code:
[StructLayout(LayoutKind.Explicit, CharSet = CharSet.Ansi, Pack = 4)]
public unsafe struct MovementFields
{
[FieldOffset(0x0), MarshalAs(UnmanagedType.ByValArray,
SizeConst = 4, ArraySubType = UnmanagedType.U4)]
public fixed uint unk1[4];
[FieldOffset(0x10), MarshalAs(UnmanagedType.R4)]
public float X; //0x10-0x14
[FieldOffset(0x14), MarshalAs(UnmanagedType.R4)]
public float Y;
[FieldOffset(0x18), MarshalAs(UnmanagedType.R4)]
public float Z;
[FieldOffset(0x1C), MarshalAs(UnmanagedType.R4)]
public float rot; //0x1C-0x20
[FieldOffset(0x20), MarshalAs(UnmanagedType.ByValArray,
SizeConst = 4, ArraySubType = UnmanagedType.U4)]
public fixed uint unk2[9];
[FieldOffset(0x44), MarshalAs(UnmanagedType.U4)]
public uint movementflag;
[FieldOffset(0x48), MarshalAs(UnmanagedType.U4)]
public uint playerstate;
[FieldOffset(0xBC), MarshalAs(UnmanagedType.U4)]
public uint unkBC;
}
That took forever to type. Any way to avoid typing all of that? Even just a little bit, because I have a LOT more classes to do like this...