Remove struct layout stuff

It broke everything using the type
This commit is contained in:
Norbi Peti 2021-05-12 00:25:07 +02:00
parent 3eef859095
commit 6fedf90380
No known key found for this signature in database
GPG key ID: DBA4C4549A927E56
2 changed files with 5 additions and 7 deletions

View file

@ -1,5 +1,4 @@
using Svelto.ECS;
using TechbloxModdingAPI.Blocks;
namespace TechbloxModdingAPI.Utility
{

View file

@ -5,14 +5,13 @@ using Svelto.ECS;
namespace TechbloxModdingAPI.Utility
{
[StructLayout(LayoutKind.Explicit)] //Make the array and managedArray fields take up the same space
public ref struct OptionalRef<T> where T : struct, IEntityComponent
{
[FieldOffset(0)] private readonly State state;
[FieldOffset(1)] private readonly uint index;
[FieldOffset(5)] private NB<T> array;
[FieldOffset(5)] private MB<T> managedArray;
[FieldOffset(1)] private readonly EntityInitializer initializer;
private readonly State state;
private readonly uint index;
private NB<T> array;
private MB<T> managedArray;
private readonly EntityInitializer initializer;
//The possible fields are: (index && (array || managedArray)) || initializer
public OptionalRef(NB<T> array, uint index)