|
|
@@ -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) |
|
|
|