Class EntityHelper
Namespace: ValveResourceFormat.Renderer.Editor.Helpers
Assembly: Renderer.dll
One of the things an entity is drawn with in the editor. An entity gets a helper for each one its class declares, and everything seen of it comes from them: its model, its icon, the light it casts.
public abstract class EntityHelperInheritance
object ← EntityHelper
Derived
BakeResourceHelper, IconHelper, ModelHelper
Constructors
EntityHelper(IHelperOwner, HelperDeclaration)
Initializes a helper of an entity.
protected EntityHelper(IHelperOwner owner, HelperDeclaration declaration)Parameters
owner IHelperOwner
The entity the helper belongs to.
declaration HelperDeclaration
The helper as the class of the entity declares it.
Properties
Declaration
Gets the helper as the class of the entity declares it.
public HelperDeclaration Declaration { get; }Property Value
HiddenInGameObjectsOnly
Gets whether the helper is hidden while only what the game shows is, unless its entity is selected.
public virtual bool HiddenInGameObjectsOnly { get; }Property Value
bool
IsStandIn
Gets whether the helper stands in for its entity in the editor, rather than drawing what the game shows of it. The game draws an entity of a compiled map, so of its helpers these are what is drawn in its place.
public virtual bool IsStandIn { get; }Property Value
bool
IsToolShape
Gets whether the helper only draws shapes of the editor, which the game does not show. An entity of a compiled map is drawn with these too.
public virtual bool IsToolShape { get; }Property Value
bool
IsVisual
Gets whether the entity is seen by this helper, which most are. An entity none of whose helpers is, is drawn as a box.
public virtual bool IsVisual { get; }Property Value
bool
NeedsShowHelpers
Gets whether the helper is only drawn while helpers are shown, which they are by default.
public virtual bool NeedsShowHelpers { get; }Property Value
bool
ObjectBounds
Gets the bounds the helper adds to those of its entity in the world, which a selection is boxed by, or null where it adds none. Most helpers add none: a sphere or a line around an entity does not make the entity any larger. An entity none of whose helpers adds any is boxed at its origin.
public virtual AABB? ObjectBounds { get; }Property Value
AABB?
Owner
Gets the entity the helper belongs to.
public IHelperOwner Owner { get; }Property Value
RequiresSelection
Gets whether nothing of the helper is drawn while its entity is not selected.
public virtual bool RequiresSelection { get; }Property Value
bool
VisibilityLayerName
Gets the visibility layer of what the helper adds to the scene, which stands in for the options of the editor: the helpers layer for a helper only drawn while helpers are shown, the editor-only entities layer for one hidden while only what the game shows is, and null, the layer of the entity, for one neither option hides.
protected string? VisibilityLayerName { get; }Property Value
string?
Methods
AddToScene()
Adds what the helper draws to the scene of the entity.
public virtual void AddToScene()GetArgument(int)
Gets an argument of the declaration, or null when it has fewer.
protected string? GetArgument(int index)Parameters
index int
Zero based index of the argument.
Returns
string?
The argument.
GetBooleanKey(string, bool)
Gets a key of the entity as a flag.
protected bool GetBooleanKey(string key, bool defaultValue)Parameters
key string
Name of the key.
defaultValue bool
The value where the entity has no such key, or where it is neither a number nor a boolean.
Returns
bool
Whether the value is a number other than zero, or true.
GetColorArguments(int)
Gets the color three arguments of the declaration give, each channel on its own: full where its argument is left out, and none where it is not a number.
protected Color32 GetColorArguments(int start)Parameters
start int
Index of the first of the three.
Returns
The color, opaque.
GetFloatKey(string, float)
Gets a key of the entity as a number.
protected float GetFloatKey(string key, float defaultValue = 0)Parameters
key string
Name of the key.
defaultValue float
The value where the entity has no such key.
Returns
float
The value.
GetIntegerKey(string, int)
Gets a key of the entity as an integer.
protected int GetIntegerKey(string key, int defaultValue = 0)Parameters
key string
Name of the key.
defaultValue int
The value where the entity has no such key.
Returns
int
The value.
GetMetadata(string)
Gets a key of the block the helper is declared with as text.
protected string? GetMetadata(string key)Parameters
key string
Name of the key.
Returns
string?
The value, or null when the helper has no such key.
GetMetadataColor(string)
Gets a color the block the helper is declared with gives as three or four numbers.
protected Color32? GetMetadataColor(string key)Parameters
key string
Name of the key.
Returns
The color, or null when the block has no such color.
GetMetadataFlag(string, bool)
Gets a flag of the block the helper is declared with.
protected bool GetMetadataFlag(string key, bool defaultValue)Parameters
key string
Name of the key.
defaultValue bool
The value where the block has no such key.
Returns
bool
The flag.
GetObjectBounds(in Matrix4x4)
Gets EntityHelper.ObjectBounds boxed in another space, where the helper knows them more tightly.
public virtual AABB? GetObjectBounds(in Matrix4x4 worldToSpace)Parameters
worldToSpace Matrix4x4
The transform from the world into the space.
Returns
AABB?
GetStringKey(string)
Gets a key of the entity as text.
protected string GetStringKey(string key)Parameters
key string
Name of the key.
Returns
string
The value, empty when the entity has no such key.
GetVector2Key(string)
Gets a key of the entity as a vector.
protected Vector2 GetVector2Key(string key)Parameters
key string
Name of the key.
Returns
The value, zero when the entity has no such key.
GetVector3Key(string, Vector3)
Gets a key of the entity as a vector.
protected Vector3 GetVector3Key(string key, Vector3 defaultValue = default)Parameters
key string
Name of the key.
defaultValue Vector3
The value where the entity has no such key.
Returns
The value.
HasArgument(string)
Gets whether any argument of the declaration is a flag, without regard to case.
protected bool HasArgument(string flag)Parameters
flag string
The flag.
Returns
bool
Whether the declaration has it.
Link()
Finds the entities the helper names. Called once every entity of the map exists, and again whenever one of them changes.
public virtual void Link()
