Skip to content

API Wrappers zh

3cxc edited this page Sep 13, 2026 · 1 revision

NativePluginKit.Features.Wrappers

跨 ABI 传递的强类型辅助类型。


EntityId

public readonly struct EntityId : IEquatable<EntityId>
{
    public readonly ulong Low;
    public readonly ulong High;

    public EntityId(ulong low, ulong high);

    public bool IsEmpty { get; }

    public static bool operator ==(EntityId a, EntityId b);
    public static bool operator !=(EntityId a, EntityId b);
}

16 字节的实体标识,表示宿主基于 Guid 的 ObjectId 的低/高 64 位。插件通过 Entity.GetEntityIdAt(index) 或 Entity.GetAllEntityIds() 获取,然后可传回任意 Entity 方法。


ObjectIdNative

[StructLayout(LayoutKind.Sequential)]
public struct ObjectIdNative
{
    public ulong Low;
    public ulong High;
}

EntityId 的原始 ABI 形式。嵌入在事件载荷中,例如 EntityDamagedEvent


枚举

public enum CardAttackType
{
    Physical = 0, Magic = 1, Fire = 2, Ice = 3, Thunder = 4, True = 5,
}

public enum CardCategory
{
    Skill = 0, Environment = 1, Special = 2,
}

public enum EffectCategory
{
    DamageOverTime = 0, Fire = 1, Stun = 2, StatMod = 3, Confuse = 4, Instant = 5,
}

数值必须与宿主枚举严格一致 (AttackType, CardType, EffectCategory)

Clone this wiki locally