Skip to content

Commit

Permalink
impl PrimitiveAdd->array
Browse files Browse the repository at this point in the history
  • Loading branch information
alec1o committed May 19, 2024
1 parent 36d3320 commit 6e6f26d
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/src/partials/PrimitiveAdd.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,19 @@ public void Struct(object value)

public void Array<T>(T[] value)
{
throw new NotImplementedException();
Vault.Add(Prefix.Array);

int size = value?.Length ?? 0;

Vault.AddRange(BitConverter.GetBytes(size));

if (size > 0 && value != null)
{
foreach (T x in value)
{
Vault.AddRange(x.ToPrimitive());
}
}
}

public void List<T>(List<T> value)
Expand Down

0 comments on commit 6e6f26d

Please sign in to comment.