Summary

The entity subsystem allows you to get design time data from a level that was edited with GEDIT. The data is streamed in from the level file so that the programmer is not required to do any post editing, runtime linking of structure elements.

Overview

The programmer is permitted to defne data in C header files, tagged with #pragma directives which delineate published, editable data, and private non-editable data. The editor parses these structure definitions and allows the level designer to edit field values in instances of the structures. The level designer can edit pointer references between the structures. The editor stores the results in the BSP file, and the engine streams the data back in to memory, using the type definitions that the editor writes to the BSP file to guide it in the reconstitution of the data.

The programmer can then query the world for a pointer to sets of data, from which individual entites can be extracted. Access to the actual structure data is had by getting the user data from an entity, and casting that to the proper structure type that matches the entity set that the entities came from. The entity set names that the editor builds match the structure name. It is up to the programmer to ensure that the actual data types match at the time of the cast.

See geWorld_GetEntitySet for more information.

Reference

geEntity *geEntity_EntitySetGetNextEntity(geEntity_EntitySet *EntitySet, geEntity *Entity)

Description: Returns the next entity in the EntitySet.

Parameters:

EntitySet EntitySet used to search.
Entity Entity to start searching from. NULL will return the first entity.

Returns: On success, returns the next entity in the EntitySet. Returns NULL otherwise.

void geEntity_GetName(const geEntity *Entity, char *Buffer, int MaxLen)

Description: Gets the user data that was created in GEdit for this entity. This data should be cast to the structure that was used in the header file asscociated with the entity,

Parameters:

Entity Entity to get the name of
Buffer Buffer to copy name to
MaxLen Size of the buffer

Returns: void

Remarks: If the name is longer than MaxLen, then the name is truncated in the result buffer.

void *geEntity_GetUserData(geEntity *Entity)

Description: Gets the user data that was created in GEdit for this entity. This data should be cast to the structure that was used in the header file asscociated with the entity,

Parameters:

Entity Entity to get the data from.

Returns: Userdata for the entity.

Remarks: This function will never return NULL.