Skip to content

RSDK_GET_ENTITY

Description

Gets the data of the given entity using the given object's entity struct.

Parameters

class

The class of the object to use the entity struct from.

slot

The slot ID of the entity to return.

Return Value

Returns the data of entity slot using object class's entity struct.

Syntax

RSDK_GET_ENTITY(class, slot);

Example

EntityMyObject *entity = RSDK_GET_ENTITY(MyObject, 12);
MyObject *entity = RSDK_GET_ENTITY(MyObject, 12);

Note

This is a macro, which is designed to make programming in RSDK easier. The underlying logic is:

((Entity##class *)RSDK.GetEntity(slot))
(GameObject::Get<class>(slot))

The underlying logic should NEVER be used as it's less safe than the macro. This note is here for anyone wishing to learn about the internals or hoping to develop a wrapper for another language that doesn't support macros.