This article's documentation is for the "GoldSrc" engine. Click here for more information.
This article's documentation is for anything that uses the Source engine. Click here for more information.

LINK_ENTITY_TO_CLASS()

From Valve Developer Community
Revision as of 08:05, 1 May 2025 by SirYodaJedi (talk | contribs) (link to w:Macro (computer science))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

LINK_ENTITY_TO_CLASS() is a C++ macro available in all Source Source and GoldSrc GoldSrc games. It is used to link a classname to a C++ class.

Syntax

In the standard Source SDK Source SDK and Half-Life SDK Half-Life SDK, the syntax is as such:

LINK_ENTITY_TO_CLASS(editor_classname, CPPClassName)

This will usually look like so:

LINK_ENTITY_TO_CLASS(info_null, CNullEntity)

ReGameDLL_CS

ReGameDLL_CS uses a modified syntax, adding an additional C++ class for server plugins:

LINK_ENTITY_TO_CLASS(editor_classname, CPPClassName, APIClassName)

This will usually look like so:

LINK_ENTITY_TO_CLASS(info_null, CNullEntity, CCSNullEntity)

See also