跳到主要内容
版本:Next

Struct Container

Namespace: OblivionMP.SDK.Common.Archetypes
Assembly: OblivionMP.SDK.Common.dll

A container placed in the world, such as a chest, barrel or sack.

[Archetype]
[Tag(typeof(AllowOwnershipTransferOnScopeEnterTag))]
[Tag(typeof(AllowOwnershipTransferOnScopeLeaveTag))]
[Include(typeof(RefIdMixin), "")]
[Include(typeof(BaseIdMixin), "")]
[Include(typeof(Transform), "")]
[Include(typeof(Presence), "")]
[Include(typeof(ContainerItems), "")]
[Include(typeof(LockState), "")]
[Include(typeof(LockSeedOrigin), "")]
[Include(typeof(ScriptVariables), "")]
[Include(typeof(ScriptPolicy), "")]
public readonly struct Container : IArchetype, IArchetypeQueryable, IEntityShape

Implements​

IArchetype, IArchetypeQueryable, IEntityShape

Inherited Members​

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Properties​

BaseId​

The form this entity is made from, such as which kind of chest or which creature.

public NetworkFormId BaseId { get; set; }

Property Value​

NetworkFormId

IsDestroyed​

Whether a script marked the object destroyed, which keeps it from activating.

public bool IsDestroyed { get; set; }

Property Value​

bool

IsDisabled​

Whether a seeded ref is enabled in the world. Starts from the game files and only the server writes it.

public bool IsDisabled { get; set; }

Property Value​

bool

IsLeveled​

public bool IsLeveled { get; set; }

Property Value​

bool

IsLocked​

public bool IsLocked { get; set; }

Property Value​

bool

IsValid​

public bool IsValid { get; }

Property Value​

bool

ItemsCount​

public int ItemsCount { get; }

Property Value​

int

Key​

public FormId Key { get; set; }

Property Value​

FormId

Level​

public int Level { get; set; }

Property Value​

int

Position​

The position in the game's world space, in centimeters.

public Vector3 Position { get; set; }

Property Value​

Vector3

RefId​

The ref id of this placed object or actor.

public uint RefId { get; set; }

Property Value​

uint

RollIndex​

How many random rolls the script made, so every client continues the same sequence.

public uint RollIndex { get; set; }

Property Value​

uint

Rotation​

The yaw, in degrees.

public float Rotation { get; set; }

Property Value​

float

Run​

How the ref's own script blocks run, SessionDefault for the session's rule of its kind.

public ScriptRunPolicy Run { get; set; }

Property Value​

ScriptRunPolicy

Target​

How script commands that change the ref run, SessionDefault for the session's rule.

public ScriptTargetPolicy Target { get; set; }

Property Value​

ScriptTargetPolicy

VariablesCount​

public int VariablesCount { get; }

Property Value​

int

Methods​

AddItems(in InventoryEntry)​

[Changes("ContainerItems.Field.Items")]
public void AddItems(in InventoryEntry value)

Parameters​

value InventoryEntry

AddVariables(in ScriptVariable)​

[Changes("ScriptVariables.Field.Variables")]
public void AddVariables(in ScriptVariable value)

Parameters​

value ScriptVariable

As<T>()​

public T As<T>() where T : struct, IArchetypeQueryable

Returns​

T

Type Parameters​

T

ClearItems()​

[Changes("ContainerItems.Field.Items")]
public void ClearItems()

ClearVariables()​

[Changes("ScriptVariables.Field.Variables")]
public void ClearVariables()

ContainsItems(in InventoryEntry)​

public bool ContainsItems(in InventoryEntry value)

Parameters​

value InventoryEntry

Returns​

bool

ContainsVariables(in ScriptVariable)​

public bool ContainsVariables(in ScriptVariable value)

Parameters​

value ScriptVariable

Returns​

bool

GetItems()​

public NativeList<InventoryEntry>.ReadOnly GetItems()

Returns​

NativeList<InventoryEntry>.ReadOnly

GetItems(int)​

public InventoryEntry GetItems(int index)

Parameters​

index int

Returns​

InventoryEntry

GetVariables()​

public NativeList<ScriptVariable>.ReadOnly GetVariables()

Returns​

NativeList<ScriptVariable>.ReadOnly

GetVariables(int)​

public ScriptVariable GetVariables(int index)

Parameters​

index int

Returns​

ScriptVariable

InsertItems(int, in InventoryEntry)​

[Changes("ContainerItems.Field.Items")]
public void InsertItems(int index, in InventoryEntry value)

Parameters​

index int

value InventoryEntry

InsertVariables(int, in ScriptVariable)​

[Changes("ScriptVariables.Field.Variables")]
public void InsertVariables(int index, in ScriptVariable value)

Parameters​

index int

value ScriptVariable

Is<T>()​

public bool Is<T>() where T : struct, IArchetypeQueryable

Returns​

bool

Type Parameters​

T

Keep()​

This entity, which it already is: a loop over this shape hands over the shape itself.

public Container Keep()

Returns​

Container

Remarks​

Here so taking something out of a loop reads the same whichever way the loop walks. Whether a shape is walked by chunk follows from what it includes, which the call site cannot see and which changes when an include does.

RemoveAtItems(int)​

[Changes("ContainerItems.Field.Items")]
public InventoryEntry RemoveAtItems(int index)

Parameters​

index int

Returns​

InventoryEntry

RemoveAtVariables(int)​

[Changes("ScriptVariables.Field.Variables")]
public ScriptVariable RemoveAtVariables(int index)

Parameters​

index int

Returns​

ScriptVariable

SetItems(in NativeList<InventoryEntry>)​

[Changes("ContainerItems.Field.Items")]
public void SetItems(in NativeList<InventoryEntry> value)

Parameters​

value NativeList<InventoryEntry>

SetItems(int, in InventoryEntry)​

[Changes("ContainerItems.Field.Items")]
public void SetItems(int index, in InventoryEntry value)

Parameters​

index int

value InventoryEntry

SetVariables(in NativeList<ScriptVariable>)​

[Changes("ScriptVariables.Field.Variables")]
public void SetVariables(in NativeList<ScriptVariable> value)

Parameters​

value NativeList<ScriptVariable>

SetVariables(int, in ScriptVariable)​

[Changes("ScriptVariables.Field.Variables")]
public void SetVariables(int index, in ScriptVariable value)

Parameters​

index int

value ScriptVariable

TryAs<T>(out T)​

public bool TryAs<T>(out T archetype) where T : struct, IArchetypeQueryable

Parameters​

archetype T

Returns​

bool

Type Parameters​

T

  • Properties
    • BaseId
    • IsDestroyed
    • IsDisabled
    • IsLeveled
    • IsLocked
    • IsValid
    • ItemsCount
    • Key
    • Level
    • Position
    • RefId
    • RollIndex
    • Rotation
    • Run
    • Target
    • VariablesCount
  • Methods
    • AddItems(in InventoryEntry)
    • AddVariables(in ScriptVariable)
    • As<T>()
    • ClearItems()
    • ClearVariables()
    • ContainsItems(in InventoryEntry)
    • ContainsVariables(in ScriptVariable)
    • GetItems()
    • GetItems(int)
    • GetVariables()
    • GetVariables(int)
    • InsertItems(int, in InventoryEntry)
    • InsertVariables(int, in ScriptVariable)
    • Is<T>()
    • Keep()
    • RemoveAtItems(int)
    • RemoveAtVariables(int)
    • SetItems(in NativeList<InventoryEntry>)
    • SetItems(int, in InventoryEntry)
    • SetVariables(in NativeList<ScriptVariable>)
    • SetVariables(int, in ScriptVariable)
    • TryAs<T>(out T)