Scripting API

Scripting API

DataAssetBinary

Class in Abyss.Core, from Abyss.Core.

A data asset as a built game's pack carries it: its struct's bytes and the field table they were written by — ABDA, a version, the kind's name, each field's name, offset, kind and count, and the bytes — so a game reads it without parsing text, and one whose struct has changed since maps each field it still has by name.

public static class DataAssetBinary

Methods

Write

public static byte[] Write(DataAssetType type, ReadOnlySpan<byte> bytes)

The packed form of an asset of type whose bytes are bytes.

Parameters

  • type
  • bytes

Read

public static (byte[]? Bytes, string? Problem) Read(DataAssetType type, ReadOnlySpan<byte> packed)

An asset of type, from its packed form: its bytes as they are where its fields are laid out as the struct's are now, and otherwise each field the struct still has — by its name, or one it was called — over what one starts as; null and why for what is not one.

Parameters

  • type
  • packed