SwiftlyS2

CEntityInstance

Interface CEntityInstance

Namespace: SwiftlyS2.Shared.SchemaDefinitions

Assembly: SwiftlyS2.CS2.dll

public interface CEntityInstance : ISchemaClass<CEntityInstance>, ISchemaField, ISchemaClass, INativeHandle

Implements

Properties

CScriptComponent

CScriptComponent? CScriptComponent { get; }
Property Value

DesignerName

The designer name of the entity.

string DesignerName { get; }
Property Value

Entity

CEntityIdentity? Entity { get; }
Property Value

Index

The index of the entity.

uint Index { get; }
Property Value

PrivateVScripts

string PrivateVScripts { get; set; }
Property Value

Methods

AcceptInput<T>(string, T?, CEntityInstance?, CEntityInstance?, int)

Fire an input to the entity.

Thread unsafe, use async variant instead for non-main thread context.

[ThreadUnsafe]
void AcceptInput<T>(string input, T? value, CEntityInstance? activator = null, CEntityInstance? caller = null, int outputID = 0)
Parameters
Type Parameters
  • T — Param type. Support bool, int, uint, long, ulong, float, double, string, Vector, Vector2D, Vector4D, QAngle, Color

AcceptInputAsync<T>(string, T?, CEntityInstance?, CEntityInstance?, int)

Fire an input to the entity asynchronously.

Task AcceptInputAsync<T>(string input, T? value, CEntityInstance? activator = null, CEntityInstance? caller = null, int outputID = 0)
Parameters
Returns
Type Parameters
  • T — Param type. Support bool, int, uint, long, ulong, float, double, string, Vector, Vector2D, Vector4D, QAngle, Color

AddEntityIOEvent<T>(string, T?, CEntityInstance?, CEntityInstance?, float)

Add an entity IO event to the entity.

Thread unsafe, use async variant instead for non-main thread context.

[ThreadUnsafe]
void AddEntityIOEvent<T>(string input, T? value, CEntityInstance? activator = null, CEntityInstance? caller = null, float delay = 0)
Parameters
Type Parameters
  • T — Param type. Support bool, int, uint, long, ulong, float, double, string, Vector, Vector2D, Vector4D, QAngle, Color

AddEntityIOEventAsync<T>(string, T?, CEntityInstance?, CEntityInstance?, float)

Add an entity IO event to the entity asynchronously.

Task AddEntityIOEventAsync<T>(string input, T? value, CEntityInstance? activator = null, CEntityInstance? caller = null, float delay = 0)
Parameters
Returns
Type Parameters
  • T — Param type. Support bool, int, uint, long, ulong, float, double, string, Vector, Vector2D, Vector4D, QAngle, Color

Despawn()

Despawn the entity.

Thread unsafe, use async variant instead for non-main thread context.

[ThreadUnsafe]
void Despawn()

DespawnAsync()

Despawn the entity asynchronously.

Task DespawnAsync()
Returns

DispatchSpawn(CEntityKeyValues?)

Dispatch a spawn event to the entity.

Thread unsafe, use async variant instead for non-main thread context.

[ThreadUnsafe]
void DispatchSpawn(CEntityKeyValues? entityKV = null)
Parameters

DispatchSpawnAsync(CEntityKeyValues?)

Dispatch a spawn event to the entity asynchronously.

Task DispatchSpawnAsync(CEntityKeyValues? entityKV = null)
Parameters
Returns

EntityUpdated()

void EntityUpdated()

IsTransmitting(int)

Check if the entity is transmitting for one player.

bool IsTransmitting(int playerId)
Parameters
  • playerId int — The player ID to check the transmit state for.
Returns

SetTransmitState(bool, int)

Set the transmit state of the entity for one player.

void SetTransmitState(bool transmitting, int playerId)
Parameters
  • transmitting bool — Whether the entity should be transmitting.
  • playerId int — The player ID to set the transmit state for.

SetTransmitState(bool)

Set the global transmit state of the entity.

void SetTransmitState(bool transmitting)
Parameters
  • transmitting bool — Whether the entity should be transmitting.

On this page