IEntitySystemService
Interfacepublic interface IEntitySystemServiceMethods
Create an entity by class.
T CreateEntity<T>() where T : class, ISchemaClass<T>- ArgumentExceptionThrown when failed to create entity by class or class doesn't have a designer name.
- InvalidOperationExceptionThrown when called too early that entity system is not valid at this moment.
Create an entity by class.
T CreateEntity<T>(int forcedIndex) where T : class, ISchemaClass<T>- forcedIndexintForced entity index.
- ArgumentExceptionThrown when failed to create entity by class or class doesn't have a designer name.
- InvalidOperationExceptionThrown when called too early that entity system is not valid at this moment.
Create an entity by designer name.
T CreateEntityByDesignerName<T>(string designerName) where T : class, ISchemaClass<T>- designerNamestringDesigner name.
- ArgumentExceptionThrown when failed to create entity by designer name or designer name is invalid.
- InvalidOperationExceptionThrown when called too early that entity system is not valid at this moment.
Create an entity by designer name.
T CreateEntityByDesignerName<T>(string designerName, int forcedIndex) where T : class, ISchemaClass<T>- ArgumentExceptionThrown when failed to create entity by designer name or designer name is invalid.
- InvalidOperationExceptionThrown when called too early that entity system is not valid at this moment.
Get all entities.
IEnumerable<CEntityInstance> GetAllEntities()- InvalidOperationExceptionThrown when called too early that entity system is not valid at this moment.
Get all entities by class.
IEnumerable<T> GetAllEntitiesByClass<T>() where T : class, ISchemaClass<T>- InvalidOperationExceptionThrown when called too early that entity system is not valid at this moment.
Get all entities by designer name, and cast to type T.
IEnumerable<T> GetAllEntitiesByDesignerName<T>(string designerName) where T : class, ISchemaClass<T>- designerNamestringDesigner name.
- InvalidOperationExceptionThrown when called too early that entity system is not valid at this moment.
Get an entity by address.
T? GetEntityByAddress<T>(nint address) where T : class, ISchemaClass<T>- addressnintEntity address.
- InvalidOperationExceptionThrown when called too early that entity system is not valid at this moment.
- InvalidOperationExceptionThrown when the entity is not of type T.
Get an entity by address.
CEntityInstance? GetEntityByAddress(nint address)- addressnintEntity address.
- InvalidOperationExceptionThrown when called too early that entity system is not valid at this moment.
Get an entity by index.
T? GetEntityByIndex<T>(uint index) where T : class, ISchemaClass<T>- indexuintEntity index.
- InvalidOperationExceptionThrown when called too early that entity system is not valid at this moment.
- InvalidOperationExceptionThrown when the entity is not of type T.
Get an entity by index. The object return will have the actual type of the entity. You can cast it to the actual type.
CEntityInstance? GetEntityByIndex(uint index)- indexuintEntity index.
- InvalidOperationExceptionThrown when called too early that entity system is not valid at this moment.
Get the game rules entity.
CCSGameRules? GetGameRules()- InvalidOperationExceptionThrown when called too early that entity system is not valid at this moment.
Get a reference handle to the entity.
CHandle<T> GetRefEHandle<T>(T entity) where T : class, ISchemaClass<T>- entityTEntity instance.
- InvalidOperationExceptionThrown when called too early that entity system is not valid at this moment.
Hooks an input of the specified entity type to a callback function.
Guid HookEntityInput<T>(string inputName, IEntitySystemService.EntityInputEventHandler callback) where T : class, ISchemaClass<T>- inputNamestringThe name of the input to hook. This value cannot be null or empty.
- callbackIEntitySystemService.EntityInputEventHandlerThe callback function to invoke when the input is accepted. This value cannot be null .
This method allows you to attach a handler to a specific input of an entity. The callback will be invoked whenever the input is accepted.
Hooks an input of the specified entity type to a callback function.
Guid HookEntityInput(string designerName, string inputName, IEntitySystemService.EntityInputEventHandler callback)- designerNamestringThe designer name of the entity to hook. This value cannot be null or empty.
- inputNamestringThe name of the input to hook. This value cannot be null or empty.
- callbackIEntitySystemService.EntityInputEventHandlerThe callback function to invoke when the input is accepted. This value cannot be null .
This method allows you to attach a handler to a specific input of an entity. The callback will be invoked whenever the input is accepted.
Hooks an output of the specified entity type to a callback function.
Guid HookEntityOutput<T>(string outputName, IEntitySystemService.EntityOutputEventHandler callback) where T : class, ISchemaClass<T>- outputNamestringThe name of the output to hook. This value cannot be null or empty.
- callbackIEntitySystemService.EntityOutputEventHandlerThe callback function to invoke when the output is triggered. This value cannot be null .
This method allows you to attach a handler to a specific output of an entity. The callback will be invoked whenever the output is triggered.
Hooks an output of the specified entity type to a callback function.
Guid HookEntityOutput(string designerName, string outputName, IEntitySystemService.EntityOutputEventHandler callback)- designerNamestringThe designer name of the entity to hook. This value cannot be null or empty.
- outputNamestringThe name of the output to hook. This value cannot be null or empty.
- callbackIEntitySystemService.EntityOutputEventHandlerThe callback function to invoke when the output is triggered. This value cannot be null .
This method allows you to attach a handler to a specific output of an entity. The callback will be invoked whenever the output is triggered.
Removes the association between the specified entity input and its handler.
bool UnhookEntityInput(Guid guid)- guidGuidThe unique identifier of the entity input to unhook.