Table of Contents

Struct String1024

Namespace
Typhon.Schema.Definition
Assembly
Typhon.Schema.Definition.dll

A text of up to MaxUtf8Bytes UTF-8 bytes, stored out of line: the component holds only this 4-byte handle, the text lives in an engine-managed segment of 1 024-byte chunks (#1094). A default handle is "no text" and costs nothing but the 4 bytes.

public struct String1024 : IEquatable<String1024>
Implements
Inherited Members

Remarks

The out-of-line storage keeps the component small, so the archetype's cluster stays dense: 1 024 inline bytes per entity would drop a cluster to a handful of entities and slow down everything that works per cluster. The price is one indirection on access, paid only by code that reads the text. Read and change the text through the entity handle — EntityRef.ReadText, EntityRefMut.SetText / ClearText — never by copying a handle from one component into another: a store that carries a handle the entity does not hold is refused.

Fields

MaxUtf8Bytes

The longest text a String1024 holds, in UTF-8 bytes: its chunk less the terminator.

public const int MaxUtf8Bytes = 1023

Field Value

int

Properties

IsEmpty

True when the handle names no text.

public readonly bool IsEmpty { get; }

Property Value

bool

Methods

Equals(object)

public override readonly bool Equals(object obj)

Parameters

obj object

Returns

bool

Equals(String1024)

public readonly bool Equals(String1024 other)

Parameters

other String1024

Returns

bool

GetHashCode()

public override readonly int GetHashCode()

Returns

int